将 PDF 包含到 pdflatex 文档中

将 PDF 包含到 pdflatex 文档中

尝试将光栅图形包含到我的文档中。据我所知,pdflatex 不支持 EPS,因此 pdf 应该是首选格式。据我了解,以下内容应该有效(完整示例):

\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{chart.pdf}
\end{document}

pdflatex出现以下错误:

LaTeX Error: Unknown graphics extension: .pdf.

完整输出为:

[root@trendline perfrep]# pdflatex example
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)
 restricted \write18 enabled.
entering extended mode
(./example.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, lo
aded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/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/latexconfig/graphics.cfg)
(./pdftex.def))) (./example.aux)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty))
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty))
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty)))
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))

! LaTeX Error: Unknown graphics extension: .pdf.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

答案1

当前目录中的文件pdftex.def有误(过时、损坏、根本不是图形驱动程序文件,...)。将文件移开,/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def应该可以找到并使用正确的文件。

pdfTeX 在 PDF 模式下支持的位图图像格式有 PNG、JPEG 和 JBIG2。当然,PDF 中的位图也可以使用。

相关内容