我在向下载的 LaTeX 模板中添加图片时遇到了很多困难。我下载并解压了模板文件夹到一个新文件夹,并尝试集成此文件夹中包含的名为“n1”的图片。不幸的是,我遇到了很多问题,并且无数次收到文件未找到的提示。
我使用的是 MikTeX 2.9,我更新了文件名数据库,并将文件 n1 添加到 Setting-Roots 下的所有特定文件夹中。我能够将该文件合并到我自己创建的其他 latex 文档中,但是,由于我无法确定的原因,我无法将文件添加到我下载的这个模板中。
我正在使用 pdfLaTeX。
每次尝试都会产生以下结果:
\includegraphics{n1} LaTeX Error: File `n1' not found.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.81 \includegraphics{n1}
?
n1 的确切路径是:
C:\Users\George\Documents\Thesis\psu-thesis\n1.png
TeX 文档的位置是:
C:\Users\George\Documents\Thesis\psu-thesis\sample.tex
如果我在序言中声明:
\graphicspath{{C:/Users/George/Documents/Thesis/psu-thesis/}}
我仍然收到上述错误。我尝试了过去帖子中建议的所有解决方案,但都没有奏效。刷新 FNDB 失败。添加绝对路径也失败了。我非常希望这里的聪明人能够想出一个解决方案!
编辑
Helloworld日志:
This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9) (preloaded format=pdflatex 2012.1.19) 4 MAY 2015 13:58
entering extended mode
**C:/Users/George/Documents/Thesis/psu-thesis/hello_world.tex
(C:/Users/George/Documents/Thesis/psu-thesis/hello_world.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-2009-06-19, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat
vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm
an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese,
romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis
sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u
senglishmax, welsh, loaded.
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo"
File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(C:\Users\George\Documents\Thesis\psu-thesis\hello_world.aux)
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <12> on input line 6.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <8> on input line 6.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <6> on input line 6.
[1
{C:/Users/George/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}]
(C:\Users\George\Documents\Thesis\psu-thesis\hello_world.aux) )
Here is how much of TeX's memory you used:
225 strings out of 494045
2698 string characters out of 3145966
48890 words of memory out of 3000000
3594 multiletter control sequences out of 15000+200000
6675 words of font info for 24 fonts, out of 3000000 for 9000
715 hyphenation exceptions out of 8191
23i,6n,17p,244b,187s stack positions out of 5000i,500n,10000p,200000b,50000s
<C:/Program File
s (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr10.pfb><C:/Program Files (
x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr12.pfb><C:/Program Files (x86
)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr17.pfb>
Output written on hello_world.pdf (1 page, 33459 bytes).
PDF statistics:
18 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)
答案1
您的模板将选项传递dvips
给 graphicx。但是由于您使用的是 pdflatex(而不是 latex + dvips),因此您欺骗了 latex,因此它不会查找正确的图形类型。删除该选项,希望您的模板不会再做这样的愚蠢的事情。