Babel 包导致图形无法显示在 PDF 中

Babel 包导致图形无法显示在 PDF 中

我制作了一个包含正文中单个图像的 Latex 文档,并在 Ubuntu 20.04.2 LTS 上使用 pdflatex (Tex Live 2019) 对其进行了编译。在生成的 PDF 中,我没有图像,只有毫无意义的符号 ,ь,。以下是文档:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1,T2A]{fontenc}
\usepackage[english]{babel}
\usepackage{graphicx}

\begin{document}
\begin{figure}
  \includegraphics[width=0.7\linewidth]{passer.jpg}
  \caption{A sparrow}
\end{figure}
\end{document}

尽管图像未出现在 PDF 中,但 pdflatex 输出中没有错误和警告。但是,当我不包含 babel 包时,该图会出现。此外,当我添加 [h] 参数时,该图会出现在输出中,但如果我包含两个图(在这种情况下,第一个图存在但第二个图不存在),问题就会再次出现。我正在处理一份西里尔文文档,所以我需要帮助,让 babel 包正确显示图形。

编译结果

编辑1:这是包含 babel 包时的编译日志:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./test1.tex
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/cyrillic/t2aenc.def
(/usr/share/texlive/texmf-dist/tex/latex/base/t2aenc.dfu))
(/usr/share/texlive/texmf-dist/tex/latex/cyrillic/t2acmr.fd))
(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty
(/usr/share/texlive/texmf-dist/tex/generic/babel/switch.def)
(/usr/share/texlive/texmf-dist/tex/generic/babel-english/english.ldf
(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.def
(/usr/share/texlive/texmf-dist/tex/generic/babel/txtbabel.def))))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def)))
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def)
(./test1.aux)
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]
Overfull \vbox (10.0pt too high) has occurred while \output is active
(./test1.aux) )
(see the transcript file for additional information){/usr/share/texmf/fonts/enc
/dvips/cm-super/cm-super-t2a.enc}</usr/share/texmf/fonts/type1/public/cm-super/
sfrm1000.pfb>
Output written on test1.pdf (1 page, 7430 bytes).
Transcript written on test1.log.

这是没有使用 babel 包的编译日志:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./test1.tex
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/cyrillic/t2aenc.def
(/usr/share/texlive/texmf-dist/tex/latex/base/t2aenc.dfu))
(/usr/share/texlive/texmf-dist/tex/latex/cyrillic/t2acmr.fd))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def)))
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def)
(./test1.aux)
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map} <./passer.jpg>]
(./test1.aux) ){/usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-t2a.enc}</us
r/share/texmf/fonts/type1/public/cm-super/sfrm1000.pfb>
Output written on test1.pdf (1 page, 72668 bytes).
Transcript written on test1.log.

编辑 2:我已将示例中的日志和图像上传到 Google Drive。以下是链接: https://drive.google.com/drive/folders/180QeQwz6L9FyM2aQXDQyNS_-_NopiaJ7?usp=sharing

答案1

在我直接从 tug.org 安装 TexLive 2021 后,问题消失了。之前,我尝试从 Ubuntu 存储库清除并重新安装 Texlive,但这没有帮助。

相关内容