1

我有一台 Mac,刚刚安装了 LaTeX 和编辑器 Texmaker。为了使用Arial字体,我通过 MiKTeX 控制台安装了它。我还发现通过这样做,已安装软件包的文件位于此处:

“/Users/Mirko/Library/Application Support/MiKTeX/texmfs/install/tex/latex”

我的问题是编辑器(TeXMaker)仍然找不到 Arial-Font。

这是我的代码:

\documentclass[pdftex,openany,11pt,twoside,a4dutch]{report}


\usepackage{uarial}
\usepackage{csquotes} 

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}   
\usepackage[T1]{fontenc}        
\usepackage{csquotes} % Setzen von Anführungsstrichen

\begin{document}

This is a test.

\end{document}

这是错误:

! LaTeX Error: File `uarial.sty' not found.Type X to quit or <RETURN> to proceed,or enter new name. (Default extension: sty)Enter file name:! Emergency stop.<read > \usepackage

但是 arial 文件夹和 arial.sty 文件位于上述文件夹中。

在 MikTeX 控制台中,我已经将文件夹输入到目录 > 设置

我感谢每一个帮助!

谢谢和问候!

这是来自 TexMaker 的日志文件:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdflatex 2019.10.27) 27 OCT 2019 13:34
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**test.tex
(./test.tex
LaTeX2e <2018-12-01>
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/report.cls
Document Class: report 2018/09/03 v1.4i Standard LaTeX document class
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/size11.clo
File: size11.clo 2018/09/03 v1.4i Standard LaTeX file (size option)
)
\c@part=\count80
\c@chapter=\count81
\c@section=\count82
\c@subsection=\count83
\c@subsubsection=\count84
\c@paragraph=\count85
\c@subparagraph=\count86
\c@figure=\count87
\c@table=\count88
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
! LaTeX Error: File `uarial.sty' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)
Enter file name:
! Emergency stop.
<read *>
l.5 \usepackage
{csquotes}^^M
*** (cannot \read from terminal in nonstop modes)
Here is how much of TeX's memory you used:
221 strings out of 492616
2365 string characters out of 6129480
60608 words of memory out of 5000000
4231 multiletter control sequences out of 15000+600000
3940 words of font info for 15 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
21i,0n,22p,110b,36s stack positions out of 5000i,500n,10000p,200000b,80000s
! ==> Fatal error occurred, no output PDF file produced!
4

1 回答 1

1

从日志文件的第一行可以看出

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) 

texmaker 没有使用您为其安装uarial软件包的 miktex 发行版,而是使用似乎也安装在您的计算机上的 texlive 发行版。从长远来看,最好在您的计算机上只安装一个 tex 发行版以避免此类问题。对于 mac,我建议保留 texlive 发行版并摆脱 miktex,因为大多数 mac 用户都使用 texlive,因此与 mac 的 miktex 相比,它经过了很好的测试。

现在您可以通过修改 texmaker 首选项来强制 texmaker 使用您的 miktex 安装,但在文档中使用 Arial 的更简单方法是从 pdflatex 切换到 xelatex 或 lualatex 并直接使用计算机上安装的 arial 字体

% !TeX TS-program = xelatex
\documentclass[openany,11pt,twoside,a4dutch]{report} 
\usepackage{fontspec} 
\setmainfont{Arial} 
\usepackage[ngerman]{babel} 
\usepackage[utf8]{inputenc} 
\usepackage{csquotes} 

\begin{document} 
This is a test. 
\end{document}  
于 2019-11-12T13:07:03.590 回答