我刚开始使用 LaTeX(TeXworks、pdfLaTeX),使用的是 Windows 7。如何将字体更改为支持数学运算的 Garamond?我从 LaTeX 字体目录中找到了这个,但它不起作用:
\documentclass[danish,a4paper,11pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{slantsc}
\usepackage{array}
\usepackage{amsmath}
\setkomafont{subsection}{\usefont{T1}{fvm}{m}{n}}
\setkomafont{section}{\usefont{T1}{fvs}{b}{n}\Large}
\setcounter{secnumdepth}{0}
\pagestyle{empty}
\usepackage[urw-garamond]{mathdesign}
\usepackage[T1]{fontenc}
\begin{document}
\section*{Garamond}
\subsection*{\textbackslash normalfont}
\normalfont\normalfont
\input catalogue
\subsection*{\textbackslash itshape}
\normalfont\itshape
\input catalogue
\newpage
\normalfont\normalfont
\input fonttable
\section{Math}
\normalfont
\[
\mathbf{B}(P)=\frac{\mu_0}{4\pi}\int\frac{\mathbf{I}\times\hat{r}'}{r'^2}dl = \frac{\mu_0}{4\pi}\,I\!\int\frac{d\boldsymbol{l}\times\hat{r}'}{r'^2}
\]
它出现以下错误:
garamond(1).tex
18
I can't find file `catalogue'.
l.18 \input catalogue
garamond(1).tex
15
LaTeX Font Warning: Font shape `T1/cmss/mb/n' undefined using `T1/cmss/m/n' instead on input line 15.
当我删除包含的行时\input
,出现以下错误:
garamond(1).tex
15
LaTeX Font Warning: Font shape `T1/cmss/mb/n' undefined using `T1/cmss/m/n' instead on input line 15.
garamond(1).tex
26
LaTeX Font Warning: Font shape `OT1/mdugm/b/n' undefined using `OT1/mdugm/m/n' instead on input line 26.
garamond(1).tex
26
LaTeX Font Warning: Font shape `OML/mdugm/b/it' undefined using `OML/mdugm/m/it' instead on input line 26.
garamond(1).tex
26
LaTeX Font Warning: Font shape `OMS/mdugm/b/n' undefined using `OMS/mdugm/m/n' instead on input line 26.
garamond(1).tex
26
LaTeX Font Warning: Font shape `OMX/mdugm/b/n' undefined using `OMX/mdugm/m/n' instead on input line 26.
garamond(1).tex
26
LaTeX Font Warning: Font shape `OML/mdugm/b/n' undefined using `OML/mdugm/b/it' instead on input line 26.
garamond(1).tex
26
LaTeX Font Warning: Font shape `MDA/mdugm/b/n' undefined using `MDA/mdugm/m/n' instead on input line 26.
garamond(1).tex
26
LaTeX Font Warning: Font shape `MDB/mdugm/b/n' undefined using `MDB/mdugm/m/n' instead on input line 26.
garamond(1).tex
LaTeX Font Warning: Some font shapes were not available, defaults substituted.
答案1
要将整个文档的文本和数学字体都设置为 Garamond,请使用:
\usepackage[urw-garamond]{mathdesign}
\usepackage[T1]{fontenc}
代码中的其他内容实际上都不相关。(我猜你是复制粘贴了代码。)
该\input
命令尝试输入纯文本/.tex 文件,但您的工作目录中没有该文件catalogue
。代码无法编译的原因是缺少它尝试的文件\input
,以及缺少的文件\end{document}
。其他一切都很好。我认为那里的字体微调命令是不必要的。