首页 > 解决方案 > pdflatex: \includegraphics{} -> 文件未找到

问题描述

首先:我知道这个问题已经出现了成百上千次。但是我在过去四个小时内找到的给定答案都没有解决我的具体问题,我在这里变得疯狂。我将非常感谢任何帮助和建议!

试图编译一个非常简单的 .tex 文件,包括一个\includegraphics命令,我最终得到一个“找不到文件”错误。以以下作为一个非常简约的例子:

\documentclass{report}
\usepackage{graphicx}

\begin{document}
\includegraphics{b}
\end{document}

图像文件实际上只是称为“b.jpg”(同时),它肯定与 tex 文件位于同一路径中。在命令中添加“.jpg”不会改变任何事情。也没有调用graphics而不是graphicsx

创建的输出文件包含以下内容:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7200 64-bit) (preloaded format=pdflatex 2019.10.6)  6 OCT 2019 17:25 entering extended mode
**"C:/Neuer Ordner/test.tex" ("C:/Neuer Ordner/test.tex" LaTeX2e <2018-12-01> ("C:\Program Files\MiKTeX 2.9\tex/latex/base\article.cls" Document Class: article 2019/08/27 v1.4j Standard LaTeX document class ("C:\Program Files\MiKTeX 2.9\tex/latex/base\size10.clo" File: size10.clo 2019/08/27 v1.4j Standard LaTeX file (size option) ) \c@part=\count80 \c@section=\count81 \c@subsection=\count82 \c@subsubsection=\count83 \c@paragraph=\count84 \c@subparagraph=\count85 \c@figure=\count86 \c@table=\count87 \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 ) ("C:\Program Files\MiKTeX
2.9\tex/latex/graphics\graphics.sty" Package: graphics 2019/07/20 v1.3b Standard LaTeX Graphics (DPC,SPQR)

("C:\Program Files\MiKTeX 2.9\tex/latex/graphics\trig.sty" Package: trig 2016/01/03 v1.10 sin cos tan (DPC) ) ("C:\Program Files\MiKTeX
2.9\tex/latex/graphics-cfg\graphics.cfg" File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration ) Package graphics Info: Driver file: pdftex.def on input line 105.

("C:\Program Files\MiKTeX 2.9\tex/latex/graphics-def\pdftex.def" File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex )) (test.aux) \openout1 = `test.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line
4. LaTeX Font Info:    ... okay on input line 4. LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 4. LaTeX Font Info:    ... okay on input line 4. LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 4. LaTeX Font Info:    ... okay on input line 4. LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 4. LaTeX Font Info:    ... okay on input line 4. LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 4. LaTeX Font Info:    ... okay on input line 4. LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 4. LaTeX Font Info:    ... okay on input line 4.

(C:\Users\rB\AppData\Roaming\MiKTeX\2.9\tex/context/base/mkii\supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] \scratchcounter=\count88 \scratchdimen=\dimen103 \scratchbox=\box27 \nofMPsegments=\count89 \nofMParguments=\count90 \everyMPshowfont=\toks14 \MPscratchCnt=\count91 \MPscratchDim=\dimen104 \MPnumerator=\count92 \makeMPintoPDFobject=\count93 \everyMPtoPDFconversion=\toks15 ) ("C:\Program Files\MiKTeX 2.9\tex/latex/oberdiek\epstopdf-base.sty" Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf

("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\infwarerr.sty" Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO) ) ("C:\Program Files\MiKTeX
2.9\tex/latex/oberdiek\grfext.sty" Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO)

("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\kvdefinekeys.sty" Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO)

("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\ltxcmds.sty" Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO) ))) ("C:\Program Files\MiKTeX
2.9\tex/latex/oberdiek\kvoptions.sty" Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)

("C:\Program Files\MiKTeX 2.9\tex/latex/graphics\keyval.sty" Package: keyval 2014/10/28 v1.15 key=value parser (DPC) \KV@toks@=\toks16 ) ("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\kvsetkeys.sty" Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO)

("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\etexcmds.sty" Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)

("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\ifluatex.sty" Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO) Package ifluatex Info: LuaTeX not detected. )))) ("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\pdftexcmds.sty" Package: pdftexcmds 2019/07/25 v0.30 Utility functions of pdfTeX for LuaTeX (HO )

("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\ifpdf.sty" Package: ifpdf 2018/09/07 v3.3 Provides the ifpdf switch ) Package pdftexcmds Info: LuaTeX not detected. Package pdftexcmds Info: \pdf@primitive is available. Package pdftexcmds Info: \pdf@ifprimitive is available. Package pdftexcmds Info: \pdfdraftmode found. ) Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
38. Package grfext Info: Graphics extension search list: (grfext)             [.pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,.PDF,.PNG,.JPG,.JPE G,.JBIG2,.JB2,.eps] (grfext)             \AppendGraphicsExtensions on input line 456. ) ! Undefined control sequence. \Ginclude@graphics ...\Ginput@path \set@curr@file 
                                                  {#1}\edef \uq@curr@file {\... l.5 \includegraphics{b}
                        The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

! Undefined control sequence. \Ginclude@graphics ...e \expandafter {\@curr@file 
                                                  }}\expandafter \filename@p... l.5 \includegraphics{b}
                        The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

! Undefined control sequence. <recently read> \unquote@name 
                               l.5 \includegraphics{b}
                        The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

! Undefined control sequence. <recently read> \quote@name 
                             l.5 \includegraphics{b}
                        The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.

! Undefined control sequence. <recently read> \quote@name 
                             l.5 \includegraphics{b}
                        The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.


! LaTeX Error: File `b' not found.

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

                                                   l.5 \includegraphics{b}
                        I could not locate the file with any of these extensions: .pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,.PDF,.PNG,.JPG,.JPEG,.JBIG2,.JB2,.eps Try typing  <return>  to proceed. If that doesn't work, type  X <return>  to quit.

[1

{C:/Users/rB/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (test.aux) )  Here is how much of TeX's memory you used:  1367 strings out of 492895  19199 string characters out of 3133488  80095 words of memory out of 3000000  5293 multiletter control sequences out of 15000+200000  3640 words of font info for 14 fonts, out of 3000000 for 9000  1141 hyphenation exceptions out of 8191  41i,4n,25p,289b,107s stack positions out of 5000i,500n,10000p,200000b,50000s <C :/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr10.pfb> Output written on test.pdf (1 page, 10121 bytes). PDF statistics:  10 PDF objects out of 1000 (max. 8388607)  0 named destinations out of 1000 (max. 500000)  1 words of extra memory for PDF output out of 10000 (max. 10000000)

为什么它以“这是 pdfTeX”开头,即使我明确选择了pdflatex?这可能是这里的关键吗?我在 TeXnicCenter 2.02 中使用 pdflatex,在 Win10 64 位中使用 MikTex 2.9。已经尝试重新安装 MikTex。

提前感谢您的帮助,非常感谢!

标签: latexpdflatex

解决方案


推荐阅读