根据这个问题pdftex-error-font-expansion-auto-expansion-is-only-possible-with-scalable
要摆脱上述错误,请加载可缩放字体,如 lmodern
\usepackage[T1]{fontenc}
\usepackage{lmodern}
事实确实如此。
但是我的问题是这样:这个 MWE 在 TL 2015 上编译成功,无需\usepackage{lmodern}
加载!但在 Windows 上使用 MikTeX 2.9 时会出现错误。相同的 Latex 文件。不仅如此,如果我删除microtype
包而不是加载lmodern
,那么 MikTeX 现在将编译它而不会出现错误。
\documentclass[12pt]{report}%
\usepackage[T1]{fontenc}
%\usepackage{lmodern} %This is only needed for MikTeX, why??
\usepackage[tracking]{microtype}
\usepackage{lipsum} % to generate filler text
\begin{document}
\lipsum[2-4]
\chapter{Introduction}
\end{document}
以上内容在 TL 2015 中编译成功,但在 MikTeX 中却出现错误:
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9 64-bit)
pdflatex index.tex
(C:\Users\me\AppData\Roaming\MiKTeX\2.9\tex\latex\microtype\mt-cmr.cfg)
[1{C:/Users/me/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}
! pdfTeX error (font expansion): auto expansion is only possible with scalable
fonts.
<to be read again>
\endgroup \set@typeset@protect
l.9 \chapter
{Introduction}
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on index.log.
现在在Linux上:
pdflatex index.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
没有错误。干净编译。现在,删除\usepackage[tracking]{microtype}
MiKTeX 就可以编译成功了:
\documentclass[12pt]{report}%
\usepackage[T1]{fontenc}
\usepackage{lipsum} % to generate filler text
\begin{document}
\lipsum[2-4]
\chapter{Introduction}
\end{document}
因此,如果未加载并运行 MikTex,则lmodern
无需加载。但如果使用 TL 而不是 MikTex,则可以加载和不加载,它都可以工作。microtype
microtype
lmodern
以下是 MiKTex 上的文件列表:
*File List*
report.cls 2007/10/19 v1.4h Standard LaTeX document class
size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
lmodern.sty 2009/10/30 v1.6 Latin Modern Fonts
microtype.sty 2013/05/23 v2.5a Micro-typographical refinements (RS)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
microtype-pdftex.def 2013/05/23 v2.5a Definitions specific to pdftex (RS)
microtype.cfg 2013/05/23 v2.5a microtype main configuration file (RS)
lipsum.sty 2014/07/27 v1.3 150 paragraphs of Lorem Ipsum dummy text
t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
mt-cmr.cfg 2013/05/19 v2.2 microtype config. file: Computer Modern Roman (
RS)
***********
以下是 TL 2015 的文件列表:
report.cls 2014/09/29 v1.4h Standard LaTeX document class
size12.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
lmodern.sty 2009/10/30 v1.6 Latin Modern Fonts
microtype.sty 2013/05/23 v2.5a Micro-typographical refinements (RS)
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
microtype-pdftex.def 2013/05/23 v2.5a Definitions specific to pdftex (RS)
microtype.cfg 2013/05/23 v2.5a microtype main configuration file (RS)
lipsum.sty 2014/07/27 v1.3 150 paragraphs of Lorem Ipsum dummy text
t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
mt-cmr.cfg 2013/05/19 v2.2 microtype config. file: Computer Modern Roman (
RS)
***********
我看到的唯一区别是keyval.sty
TL 上是1.15
,而 MikTex 上是 1.13
以下是 MikTex 的完整控制台输出,显示了所有已加载的字体:
X:\data\latex\empty_page>pdflatex index.tex
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9 64-bit)
entering extended mode
(X:\data\latex\empty_page\index.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2013-05-26, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2013-05-26, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\report.cls"
Document Class: report 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size12.clo"))
("C:\Program Files\MiKTeX 2.9\tex\latex\base\fontenc.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\base\t1enc.def"))
(C:\Users\me\AppData\Roaming\MiKTeX\2.9\tex\latex\microtype\microtype.sty
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty")
(C:\Users\me\AppData\Roaming\MiKTeX\2.9\tex\latex\microtype\microtype-pdftex.de
f) (C:\Users\me\AppData\Roaming\MiKTeX\2.9\tex\latex\microtype\microtype.cfg))
(C:\Users\me\AppData\Roaming\MiKTeX\2.9\tex\latex\lipsum\lipsum.sty)
(X:\data\latex\empty_page\index.aux)
(C:\Users\me\AppData\Roaming\MiKTeX\2.9\tex\latex\microtype\mt-cmr.cfg)
[1{C:/Users/me/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}
! pdfTeX error (font expansion): auto expansion is only possible with scalable
fonts.
<to be read again>
\endgroup \set@typeset@protect
l.9 \chapter
{Introduction}
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on index.log.
问题是:谁说得对?MikTeX 还是 TL?既然都是 Latex,它们应该以同样的方式工作吗?我只是想了解发生了什么,仅此而已 :)
更新:
T1
这是使用和lmodern
不使用 microtype时的 MiKTex 控制台输出
X:\data\latex\empty_page>pdflatex index.tex
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9 64-bit)
entering extended mode
(X:\data\latex\empty_page\index.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2013-05-26, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2013-05-26, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\report.cls"
Document Class: report 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size12.clo"))
("C:\Program Files\MiKTeX 2.9\tex\latex\base\fontenc.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\base\t1enc.def"))
("C:\Program Files\MiKTeX 2.9\tex\latex\lm\lmodern.sty")
(C:\Users\me\AppData\Roaming\MiKTeX\2.9\tex\latex\lipsum\lipsum.sty)
(X:\data\latex\empty_page\index.aux)
("C:\Program Files\MiKTeX 2.9\tex\latex\lm\t1lmr.fd") [1{C:/Users/me/AppData/Lo
cal/MiKTeX/2.9/pdftex/config/pdftex.map}]
Chapter 1.
[2] (X:\data\latex\empty_page\index.aux)
*File List*
report.cls 2007/10/19 v1.4h Standard LaTeX document class
size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
lmodern.sty 2009/10/30 v1.6 Latin Modern Fonts
lipsum.sty 2014/07/27 v1.3 150 paragraphs of Lorem Ipsum dummy text
t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
***********
){C:/Program Files/MiKTeX 2.9/fonts/enc/dvips/lm/lm-ec.enc}<C:/Program Files/M
iKTeX 2.9/fonts/type1/public/lm/lmbx12.pfb><C:/Program Files/MiKTeX 2.9/fonts/t
ype1/public/lm/lmr12.pfb>
Output written on index.pdf (2 pages, 53427 bytes).
Transcript written on index.log.
这是 MikTex 的输出,使用时T1
、不使用时lmodern
以及不使用时microtype
X:\data\latex\empty_page>pdflatex index.tex
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9 64-bit)
entering extended mode
(X:\data\latex\empty_page\index.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2013-05-26, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2013-05-26, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\report.cls"
Document Class: report 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size12.clo"))
("C:\Program Files\MiKTeX 2.9\tex\latex\base\fontenc.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\base\t1enc.def"))
(C:\Users\me\AppData\Roaming\MiKTeX\2.9\tex\latex\lipsum\lipsum.sty)
(X:\data\latex\empty_page\index.aux) [1{C:/Users/me/AppData/Local/MiKTeX/2.9/pd
ftex/config/pdftex.map}]
Chapter 1.
[2] (X:\data\latex\empty_page\index.aux)
*File List*
report.cls 2007/10/19 v1.4h Standard LaTeX document class
size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
lipsum.sty 2014/07/27 v1.3 150 paragraphs of Lorem Ipsum dummy text
***********
) <C:\Users\me\AppData\Local\MiKTeX\2.9\fonts\pk\ljfour\jknappen\ec\dpi600\ecb
x2488.pk> <C:\Users\me\AppData\Local\MiKTeX\2.9\fonts\pk\ljfour\jknappen\ec\dpi
600\ecrm1200.pk>
Output written on index.pdf (2 pages, 23789 bytes).
Transcript written on index.log.
更新 2
使用 MikTex 包管理器,它显示cm-super
默认情况下未安装,就像 TL 的情况一样。因此在 Windows 上安装它:(64 MB 大小)
starting package maintenance...
going to download 64797738 bytes
going to install 840 file(s) (1 package(s))
downloading http://ftp.math.purdue.edu/mirrors/ctan.org/systems/win32/miktex/tm/packages/cm-super.tar.lzma...
现在上面的第一个例子在 MikTex 上编译成功了。这是控制台输出
pdflatex index.tex
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (MiKTeX 2.9 64-bit)
entering extended mode
(X:\data\latex\empty_page\index.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2013-05-26, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, latin, latvian,
lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerman, n
german-x-2013-05-26, nynorsk, oriya, panjabi, pinyin, polish, portuguese, roman
ian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swissgerm
an, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, usengl
ishmax, welsh, loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\report.cls"
Document Class: report 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size12.clo"))
("C:\Program Files\MiKTeX 2.9\tex\latex\base\fontenc.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\base\t1enc.def"))
(C:\Users\me\AppData\Roaming\MiKTeX\2.9\tex\latex\microtype\microtype.sty
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty")
(C:\Users\me\AppData\Roaming\MiKTeX\2.9\tex\latex\microtype\microtype-pdftex.de
f) (C:\Users\me\AppData\Roaming\MiKTeX\2.9\tex\latex\microtype\microtype.cfg))
(C:\Users\me\AppData\Roaming\MiKTeX\2.9\tex\latex\lipsum\lipsum.sty)
(X:\data\latex\empty_page\index.aux)
(C:\Users\me\AppData\Roaming\MiKTeX\2.9\tex\latex\microtype\mt-cmr.cfg)
[1{C:/Users/me/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]
Chapter 1.
[2] (X:\data\latex\empty_page\index.aux)
*File List*
report.cls 2007/10/19 v1.4h Standard LaTeX document class
size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
fontenc.sty
t1enc.def 2005/09/27 v1.99g Standard LaTeX file
microtype.sty 2013/05/23 v2.5a Micro-typographical refinements (RS)
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
microtype-pdftex.def 2013/05/23 v2.5a Definitions specific to pdftex (RS)
microtype.cfg 2013/05/23 v2.5a microtype main configuration file (RS)
lipsum.sty 2014/07/27 v1.3 150 paragraphs of Lorem Ipsum dummy text
mt-cmr.cfg 2013/05/19 v2.2 microtype config. file: Computer Modern Roman (
RS)
***********
){C:/Users/me/AppData/Roaming/MiKTeX/2.9/fonts/enc/dvips/cm-super/cm-super-t1.
enc}<C:/Users/me/AppData/Roaming/MiKTeX/2.9/fonts/type1/public/cm-super/sfbx248
8.pfb><C:/Users/me/AppData/Roaming/MiKTeX/2.9/fonts/type1/public/cm-super/sfrm1
200.pfb>
Output written on index.pdf (2 pages, 32481 bytes).
Transcript written on index.log.
可怜的用户怎么知道这些事情?包太多了。如果 TL 默认安装 cm-super,我认为 MikTeX 也应该这样做。
答案1
TeX Live 包括cm-超级.如果你写
\usepackage[T1]{fontenc}
然后字体来自cm-超级被使用,并且这些是可扩展的。因此,您不会收到错误。
我认为你没有cm-超级为 MikTeX 安装,因此您会收到错误。否则,MikTeX 出于某种原因不会默认使用这些字体,即使T1
请求了。
我没有 MikTeX,所以我不知道它在这种情况下会做什么。但由于这个原因,TL 中没有出现此错误。
事实上,使用 TeX Live 2015,即使T1
没有选择,也可以使用 Computer Modern 的可扩展版本。