背景
我使用的是带有标准存储库包的 Ubuntu Precise,而不是手动安装的 TeXLive。我试图在我正在编写的论文的参考书目中包含一些西里尔文pdflatex
,遵循埃格尔的建议最好的选择是使用
\usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}
但即使是一个非常简单的测试用例
\documentclass[a4paper]{article}
\usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}
\begin{document}
Testing \foreignlanguage{russian}{Обмен шифрами}
\end{document}
给出错误:
This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
entering extended mode
(./minimum.tex
LaTeX2e <2009/09/24>
<snip>
kpathsea: Running mktextfm larm1000
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000
/usr/bin/mktextfm: 96: /usr/bin/mktextfm: mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000: not found
grep: larm1000.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000' failed to make larm1000.tfm.
kpathsea: Appending font creation commands to missfont.log.
! Font T2A/cmr/m/n/10=larm1000 at 10.0pt not loadable: Metric (TFM) file not fo
und.
<to be read again>
relax
l.8 ...anguage{russian}{Обмен шифрами}
我认为唯一相关的额外信息minimum.log
是
LaTeX Font Info: Try loading font information for T2A+cmr on input line 7.
(/usr/share/texmf-texlive/tex/latex/cyrillic/t2acmr.fd
File: t2acmr.fd 2001/08/11 v1.0a Computer Modern Cyrillic font definitions
)
LaTeX Font Info: ... okay on input line 7.
! Font T2A/cmr/m/n/10=larm1000 at 10.0pt not loadable: Metric (TFM) file not fo
und.
更多详细信息
我不明白所有的间接层级,但为了追踪它们,我运行了
$ grep -rE "\blarm([^0-9]|1000)" /usr/share/tex* 2>/dev/null
Binary file /usr/share/texmf/fonts/type1/public/cm-super/sfrm1000.pfb matches
/usr/share/texmf/fonts/map/dvips/cm-super/cm-super-minimal-t2a.map:larm1000 SFRM1000 "T2AEncoding ReEncodeFont" <cm-super-t2a.enc <sfrm1000.pfb
/usr/share/texmf-texlive/scripts/pkfix/pkfix.pl:# same type 1 font, eg. (ecrm1000, larm1000) -> SFRM1000.
/usr/share/texmf-texlive/tex/latex/cyrillic/t2acmr.fd:\EC@family{T2A}{cmr}{m}{n}{larm}
/usr/share/texmf-texlive/doc/fonts/lh/fonttest/allenc0.tex:\FontPage {larm1000}
/usr/share/texmf-texlive/doc/fonts/lh/fonttest/allenc2.tex:\FontPage {larm1000}
/usr/share/texmf-texlive/doc/generic/t2/examples/example2.tex:\font\larm=larm1000 % Set the default font --- Cyrillic
/usr/share/texmf-texlive/doc/generic/t2/examples/example2.tex:\larm % T2A encoded Computer Modern font.
/usr/share/texmf-texlive/fonts/map/dvips/updmap/psfonts.map:larm1000 SFRM1000 "T2AEncoding ReEncodeFont" <cm-super-t2a.enc <sfrm1000.pfb
/usr/share/texmf-texlive/fonts/map/dvips/updmap/psfonts_t1.map:larm1000 SFRM1000 "T2AEncoding ReEncodeFont" <cm-super-t2a.enc <sfrm1000.pfb
/usr/share/texmf-texlive/fonts/map/dvips/updmap/ps2pk.map:larm1000 SFRM1000 "T2AEncoding ReEncodeFont" <cm-super-t2a.enc <sfrm1000.pfb
/usr/share/texmf-texlive/fonts/map/fontname/special.map:larm lh lh-t2a
/usr/share/texmf-texlive/fonts/map/pdftex/updmap/pdftex_ndl14.map:larm1000 SFRM1000 "T2AEncoding ReEncodeFont" <cm-super-t2a.enc <sfrm1000.pfb
/usr/share/texmf-texlive/fonts/map/pdftex/updmap/pdftex.map:larm1000 SFRM1000 "T2AEncoding ReEncodeFont" <cm-super-t2a.enc <sfrm1000.pfb
/usr/share/texmf-texlive/fonts/map/pdftex/updmap/pdftex_dl14.map:larm1000 SFRM1000 "T2AEncoding ReEncodeFont" <cm-super-t2a.enc <sfrm1000.pfb
/usr/share/texmf-texlive/fonts/map/dvipdfm/updmap/dvipdfm_dl14.map:larm1000 cm-super-t2a sfrm1000 -r
/usr/share/texmf-texlive/fonts/map/dvipdfm/updmap/dvipdfm_ndl14.map:larm1000 cm-super-t2a sfrm1000 -r
/usr/share/texmf-texlive/fonts/map/dvipdfm/updmap/dvipdfm.map:larm1000 cm-super-t2a sfrm1000 -r
我有/usr/share/texmf/fonts/type1/public/cm-super/sfrm1000.pfb
来自/usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-t2a.enc
Ubuntu 包cm-super-minimal
,所以我认为我有源文件,只是缺少一些文件来将它们全部联系在一起。
问题
我不太关心修复底层问题——现在提出 Precise 补丁有点晚了,因为它现在处于支持模式。但我如何才能获取或生成我缺少的文件,并让我的文档编译并显示西里尔文本?
答案1
pdflatex
实际上是在尝试创建丢失的文件,但存在一些权限问题。我不知道如何解决真正的问题,但有两种解决方法可以让您编译文档。
线索
错误消息谈到了mktextfm larm1000
。如果您尝试直接从 shell 运行该命令,则会收到相同的错误:
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000
/usr/bin/mktextfm: 96: /usr/bin/mktextfm: mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000: not found
grep: larm1000.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000' failed to make larm1000.tfm.
解决方法 1
如果你sudo
这样做,它就会成功,虽然它写入的文件位于其中~/.texmf-var
,并且显然不需要超出您所拥有的权限的任何权限。
解决方法 2
错误消息还显示mktextfm
正在尝试运行
mf-nowin -progname=mf "\mode:=ljfour; mag:=1; nonstopmode; input larm1000"
您可以在不使用 的情况下运行该程序sudo
;它将创建~/.texmf-var/fonts/source/lh/lh-t2a/larm1000.mf
以及./larm1000.600gf
、./larm1000.log
和./larm1000.tfm
。pdflatex
现在将编译您的文档。但是,最好
mv ./larm1000.tfm ~/.texmf-var/fonts/tfm/lh/lh-t2a/
因为否则,如果您尝试从不同的工作目录编译西里尔字母的文档,您将来可能会遇到同样的问题。