2

When I do

Latex > DVItoPS > PStoPDF  

figures appear correctly. But when I use XeLaTex, it misplaces some figures over text. I draw the frame of eps files by

\frame{\includegraphics[width=1\columnwidth]{eps/my_fig.eps}}

and the frame appears in the correct position, but the figure is totally shifted down and left.

When I open eps files with eps viewer it looks correct, and I also used epstool to correct boundary boxes.

What could be the problem?

I tried an minimum working example, and it works.

But here is the problematic code, that causes all problems. When I delete that the figures appear correctly.

\ifCLASSINFOpdf
  \usepackage[pdftex]{graphicx}
  % declare the path(s) where your graphic files are
   \graphicspath{{../pdf/}{../jpeg/}{../eps/}{eps/}}
  % and their extensions so you won't have to specify these with
  % every instance of \includegraphics
   \DeclareGraphicsExtensions{.pdf,.jpeg,.png, .eps}
\else
  % or other class option (dvipsone, dvipdf, if not using dvips). graphicx
  % will default to the driver specified in the system graphics.cfg if no
  % driver is specified.
   \usepackage[dvips]{graphicx}
  % declare the path(s) where your graphic files are
   \graphicspath{{../eps/}{eps/}{data/}}
  % and their extensions so you won't have to specify these with
  % every instance of \includegraphics
  \DeclareGraphicsExtensions{.eps}
\fi

UPDATE: pdflatex also produces figures correctly.

3
  • 2
    The code assumes only pdftex or dvi + dvips. XeTeX requires xetex.def. Usually, except for a few cases, a suitable driver is taken automatically by calling graphicx package without a driver option. Jan 13, 2016 at 6:34
  • @AkiraKakuto yes I changed pdftex to xetex above, still the same problem.
    – Emmet B
    Jan 13, 2016 at 6:35
  • The code that was suggested to you is wrong: the pdftex or dvips options should never be passed to graphicx. Just remove that code and simply add \usepackage{graphicx}.
    – egreg
    Jan 13, 2016 at 7:22

1 Answer 1

2

I'm not sure why the IEEE templates continue to suggest adding that code, which is wrong to begin with.

Just replace that code by

\usepackage{graphicx}

You may want to add a \graphicspath declaration, but it's optional. Don't add \DeclareGraphicsExtensions command.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .