epstopdf 存在问题,“未找到”

epstopdf 存在问题,“未找到”

我读过几篇关于这个问题的帖子,并尝试按照其中的修复方法操作,但仍然无济于事。所以我使用 TexStudio 和 TexLive 并运行 pdflatex 编译器。

这似乎是一个类似的问题线

但是按照这些答案并添加 \epstopdfsetup{outdir=./} 来解决路径问题并没有帮助。

我将提供一个独立的测试代码来强调这个问题。

\documentclass{paper}

\usepackage{graphicx}
\usepackage{epstopdf}
\epstopdfsetup{outdir=./}

 \graphicspath{"C:/Users/XMAWAL/Example/Images/"}
 \begin{document}


\begin{figure}[]
\includegraphics[width=0.5\textwidth]{image1.png}
\caption{asdfasdf}
\label{fig:1}
\end{figure}


\begin{figure}[]
\includegraphics[]{image2.eps}
\caption{asdf}
\label{fig:2}
\end{figure}


\end{document}

第一张图片效果很好。只是 epstopdf 似乎无法从 eps 生成 PDf。知道为什么会发生这种情况吗?

这会产生错误消息:

 Package pdftex.def Error: File `./image2-eps-converted-to.pdf' not found. ...cs[]{image2.eps}

以及以下错误日志文件:

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/W32TeX) (preloaded format=pdflatex 2017.2.15)  13 MAY 2017 15:53
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**./texstudio_WE8212.tex
(./texstudio_WE8212.tex
LaTeX2e <2017/01/01> patch level 1
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(c:/texlive/2016/texmf-dist/tex/latex/paper/paper.cls
Document Class: paper 2008/05/30 1.0l LaTeX document class (wm).
\hours=\count79
\minutes=\count80
(c:/texlive/2016/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\beforetitlespace=\skip41
\c@part=\count81
\c@section=\count82
\c@subsection=\count83
\c@subsubsection=\count84
\c@paragraph=\count85
\c@subparagraph=\count86
\exampleindent=\skip42
\c@figure=\count87
\c@table=\count88
\abovecaptionskip=\skip43
\belowcaptionskip=\skip44
\bibindent=\dimen102
)
(c:/texlive/2016/texmf-dist/tex/latex/graphics/graphicx.sty
Package: graphicx 2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)

(c:/texlive/2016/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks14
)
(c:/texlive/2016/texmf-dist/tex/latex/graphics/graphics.sty
Package: graphics 2016/10/09 v1.0u Standard LaTeX Graphics (DPC,SPQR)

(c:/texlive/2016/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
)
(c:/texlive/2016/texmf-dist/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 99.

(c:/texlive/2016/texmf-dist/tex/latex/graphics-def/pdftex.def
File: pdftex.def 2017/01/12 v0.06k Graphics/color for pdfTeX

(c:/texlive/2016/texmf-dist/tex/generic/oberdiek/infwarerr.sty
Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)
)
(c:/texlive/2016/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
)
\Gread@gobject=\count89
))
\Gin@req@height=\dimen103
\Gin@req@width=\dimen104
)
(c:/texlive/2016/texmf-dist/tex/latex/oberdiek/epstopdf.sty
Package: epstopdf 2016/05/15 v2.6 Conversion with epstopdf on the fly (HO)

(c:/texlive/2016/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf

(c:/texlive/2016/texmf-dist/tex/latex/oberdiek/grfext.sty
Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO)

(c:/texlive/2016/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty
Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO)
))
(c:/texlive/2016/texmf-dist/tex/latex/oberdiek/kvoptions.sty
Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)

(c:/texlive/2016/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO)

(c:/texlive/2016/texmf-dist/tex/generic/oberdiek/etexcmds.sty
Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)

(c:/texlive/2016/texmf-dist/tex/generic/oberdiek/ifluatex.sty
Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
Package etexcmds Info: Could not find \expanded.
(etexcmds)             That can mean that you are not using pdfTeX 1.50 or
(etexcmds)             that some package has redefined \expanded.
(etexcmds)             In the latter case, load this package earlier.
)))
(c:/texlive/2016/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
Package: pdftexcmds 2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO
)

(c:/texlive/2016/texmf-dist/tex/generic/oberdiek/ifpdf.sty
Package: ifpdf 2016/05/14 v3.1 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)             [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE
G,.JBIG2,.JB2,.eps]
(grfext)             \AppendGraphicsExtensions on input line 456.

(c:/texlive/2016/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
e
)))
(./texstudio_WE8212.aux)
\openout1 = `texstudio_WE8212.aux'.

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

(c:/texlive/2016/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count90
\scratchdimen=\dimen105
\scratchbox=\box26
\nofMPsegments=\count91
\nofMParguments=\count92
\everyMPshowfont=\toks15
\MPscratchCnt=\count93
\MPscratchDim=\dimen106
\MPnumerator=\count94
\makeMPintoPDFobject=\count95
\everyMPtoPDFconversion=\toks16
)
<"C:/Users/XMAWAL/Google Drive/Master thesis - Mattias Wallin/Images/"hybrid_st
epper_motor_schematic.png, id=1, 507.39563pt x 494.59781pt>
File: "C:/Users/XMAWAL/Google Drive/Master thesis - Mattias Wallin/Images/"hybr
id_stepper_motor_schematic.png Graphic file (type png)

<use "C:/Users/XMAWAL/Google Drive/Master thesis - Mattias Wallin/Images/"hybri
d_stepper_motor_schematic.png>
Package pdftex.def Info: "C:/Users/XMAWAL/Google Drive/Master thesis - Mattias 
Wallin/Images/"hybrid_stepper_motor_schematic.png used on input line 13.
(pdftex.def)             Requested size: 172.5pt x 168.14592pt.
Package epstopdf Info: Source file: <"C:/Users/XMAWAL/Google Drive/Master thesi
s - Mattias Wallin/Images/"microstepping.eps>
(epstopdf)                    date: 2017-05-13 12:19:04
(epstopdf)                    size: 212900 bytes
(epstopdf)             Output file: <./"microstepping-eps-converted-to.pdf>
(epstopdf)             Command: <repstopdf --outfile=./"microstepping-eps-conve
rted-to.pdf "C:/Users/XMAWAL/Google Drive/Master thesis - Mattias Wallin/Images
/"microstepping.eps>
(epstopdf)             \includegraphics on input line 20.
runsystem(repstopdf --outfile=./"microstepping-eps-converted-to.pdf "C:/Users/X
MAWAL/Google Drive/Master thesis - Mattias Wallin/Images/"microstepping.eps)...
quotation error in system command.

Package epstopdf Info: Result file: <./"microstepping-eps-converted-to.pdf>.


! Package pdftex.def Error: File `./microstepping-eps-converted-to.pdf' not fou
nd.

See the pdftex.def package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.20 ...cs[width=0.5\textwidth]{microstepping.eps}

Using draft setting for this image.
Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

[1{c:/texlive/2016/texmf-var/fonts/map/pdftex/updmap/pdftex.map} <c:/Users/XMAW
AL/Google Drive/Master thesis - Mattias Wallin/Images/hybrid_stepper_motor_sche
matic.png>] (./texstudio_WE8212.aux) ) 
Here is how much of TeX's memory you used:
 1637 strings out of 493013
 23366 string characters out of 6136993
 79835 words of memory out of 5000000
 5190 multiletter control sequences out of 15000+600000
 4718 words of font info for 18 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 42i,7n,23p,337b,230s stack positions out of 5000i,500n,10000p,200000b,80000s
<c:/texlive/2016/texmf-dist/fonts/type1/p
ublic/amsfonts/cm/cmr10.pfb><c:/texlive/2016/texmf-dist/fonts/type1/public/amsf
onts/cm/cmr9.pfb><c:/texlive/2016/texmf-dist/fonts/type1/public/amsfonts/cm/cms
s10.pfb><c:/texlive/2016/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt10.pfb>
Output written on texstudio_WE8212.pdf (1 page, 89925 bytes).
PDF statistics:
 27 PDF objects out of 1000 (max. 8388607)
 17 compressed objects within 1 object stream
 0 named destinations out of 1000 (max. 500000)
 6 words of extra memory for PDF output out of 10000 (max. 10000000)

答案1

日志文件包含以下行:

Package epstopdf Info: Result file: <./"microstepping-eps-converted-to.pdf>.

! Package pdftex.def Error: File `./microstepping-eps-converted-to.pdf' not found.

请注意 epstopdf 创建(或至少尝试创建)文件中的引文。此额外引文是由 中的引文引起的\graphicspath

如果你的路径不包含任何空格,则不需要引号,你可以直接使用\graphicspath{{C:/Users/XMAWAL/Example/Images/}}。如果你的路径包含空格,最简单的解决方案是将图像移动到不包含空格的文件夹中。epstopdf也许可以和平地处理包含空格的路径,但我不知道怎么做。

答案2

我在将 eps 转换为 pdf 时遇到了类似的问题。日志显示错误消息为“文件未找到”。我认为问题出在图形名称上。它的名称中有一个空格(例如 bus voltage.eps)。当我通过删除空格将图形名称更改为 busVoltage.eps 时,问题得到了解决。

如果图形路径中有空格,也会弹出错误。最好用 _ 避免空格。

我希望这有帮助。

相关内容