2

I am trying to compile a document using pdflatex but I lose all figures (they look blank). The document was created by using the TeX + DVI typeset, and now I'm trying to change this to Pdftex. Is there a simple way to get around this issue? Can I just add something to the document so that Pdftex converts the eps figures I have on the fly?

I tried converting the figures myself using epstopdf, but there are some figures where there is some superimposed text and this approach doesn't work, for example:

\begin{figure}
\setlength{\unitlength}{1cm}
\begin{center}
\begin{picture}(8,6)(0.0,-0.5)
%\includegraphics[width=8cm]{cont_equi}
\put(0.3,-0.3){\psfig{figure=figures/cont_equi.eps,width=8cm}}
\put(0,2.8){$\sigma_{11}$\footnotesize$(x_1,x_2,x_3)$}
\put(6.7,2.8){$\sigma_{11}$\footnotesize$(x_1+dx_1,x_2,x_3)$}
\put(3.3,2.2){$\sigma_{12}$\footnotesize$(x_1,x_2,x_3)$}
\put(3.8,3.3){$\sigma_{12}$\footnotesize$(x_1,x_2+dx_2,x_3)$}
\put(4.2,4.3){$\sigma_{13}$\footnotesize$(x_1,x_2,x_3+dx_3)$}
\put(3.2,0.9){$\sigma_{13}$\footnotesize$(x_1,x_2,x_3)$}
\put(-0.4,1.5){$x_3$}
\put(1.6,-0.1){$x_1$}
\put(1.,1.1){$x_2$}
\put(3.6,-0.5){$dx_1$}
\put(8.4,3.7){$dx_3$}
\put(7.2,1){$dx_2$}
\end{picture}
\end{center}
\caption{Equilibrium in a continuous systems}
\label{fig:cont_equi}
\end{figure}

In the code above, uncommenting the includegraphics statement and commenting the next line shifts all manually added equations to the right.

  • 1
    Add usepackage{epstopdf} and compile with pdflatex -shell-escape file – karlkoeller Jan 14 '15 at 16:32
  • That didn't work – aaragon Jan 14 '15 at 16:33
  • 1
    Have you tried that already? What errors do you get? – karlkoeller Jan 14 '15 at 16:34
  • I put on the preamble \usepackage{epstopdf} and the document compiles, but I don't see the figures being converted. All the eps figures look blank. – aaragon Jan 14 '15 at 16:35
  • Did you put it after \usepackage{graphicx} and have enabled --shell-escape option? – karlkoeller Jan 14 '15 at 16:38
3

\includegraphics should be put inside \put as \psfig. Otherwise the following \put commands are moved to the right by the width of the \includegraphics statement. Also the translation of the \put command for \psfig would be lost.

\begin{picture}(8,6)(0.0,-0.5)
  \put(0.3,-0.3){\includgraphics[width=8cm]{cont_equi}}
  \put(0,2.8){$\sigma_{11}$\footnotesize$(x_1,x_2,x_3)$}
  ...

\end{picture}
  • That solved the problem that the figure is moving to the right, but still I can't seem to convert automatically those eps figures to pdf on the fly. – aaragon Jan 14 '15 at 17:13
  • @aaragon With a modern TeX distribution the conversion should work on the fly. Otherwise the shell-escape/write18 feature needs to be enabled and package epstopdf to be loaded (if it is not done automatically by graphics.cfg). – Heiko Oberdiek Jan 14 '15 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.