【解决方法】Latex使用eps格式图片报错

用matlab制作了eps格式的矢量图片,在latex中使用时编译报错如下:

! Package pdftex.def Error: File `figures/lambda-eps-converted-to.pdf' not foun

d: using draft setting.

See the pdftex.def package documentation for explanation.

Type H for immediate help.

...

l.451 ...egraphics[width=8 cm]{figures/lambda.eps}

?

我用的latex编辑器是MikTex,参考了网上的资料

MikTeX 2.9 报错Could not open the file Definitions/logo-mdpi-eps-converted-to.pdf_五月雨放晴时段的博客-CSDN博客MikTeX 2.9 使用问题的记录(1)部分相关错误信息如下:MiKTeX GPL Ghostscript 9.25: **** Could not open the file Definitions/logo-mdpi-eps-converted-to.pdf .**** Unable to open the initial device, quitting.Sorry, but “...https://blog.csdn.net/wrccrwx/article/details/87891257说要在\begin{document}对应的那一行,之前加上\epstopdfsetup{outdir=./}

然而编译还是失败,报错信息变为

! Undefined control sequence.

\epstopdfsetup

l.16 \epstopdfsetup

{outdir=./}

?

猜测epstopdf是一个包,于是通过\usepackage{epstopdf}引入这个包,编译成功。

总结:

在导入包的部分加入如下两行代码

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

你可能感兴趣的:(Matlab,latex,miktex,eps)