I am a learner to Latex. I am using Texstudio to edit the word. When I try to insert a .eps
format figure, this error happens. Error: Package pdftex.def Error
The code is:
\documentclass{book}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage{graphics}
\begin{document}
\begin{figure}
\includegraphics{123.eps}
\end{figure}
\end{document}
Thanks a lot,
Hannah
Best Answer
You should not put the extension
.eps
to the figure file. The packageepstopdf
inserts, by default,.eps
at the end of the graphics file name. Otherwise, you will get the errorSecond, you should use
--shell-escape
while compiling:where
yourfile
is your main.tex
file.Third, don't use
graphicx
andgraphics
both. Usegraphicx
(more modern thangraphics
) and load it beforeepstopdf
.With all above, the MWE is