Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I recently updated MikTex and it seems Xelatex is not able to place figures correctly anymore. Before updating all figures were shown correctly. I work with Texworks and Miktex 2.9

Here it is the code that I run:

\documentclass[10pt,a4paper]{report}
\usepackage{graphicx}
\graphicspath{{method1/}{method2/}{dpfig/}}

\begin{document}

\begin{figure}[!htbp]
\centering
\begin{tabular}{cc}
\includegraphics[trim=6cm 2.5cm 6cm 2.5cm,clip=true,width=0.33\textwidth]{figure1.eps}&
\includegraphics[trim=6cm 2.5cm 6cm 2.5cm,clip=true,width=0.33\textwidth]{figure2.eps}\\
\end{tabular}
\caption{Two figures}
\end{figure}
\end{document}
\end{figure}

With this code, figures are correctly trimmed and the relative position between figure 1 and figure 2 is maintained. However, the position in the document is wrong: figure are placed upper and more right than expected (as the bottom-left corner of the table was placed in the middle of the page). The unusual thing is that this does not happen in draft mode and picture are shown centered as it would be.

I usually compile with Xelatex, Makeindex and Bibtex.

I hope to have been clear.. bye!

EDIT: Sorry, I forgot to add the images I prepared from the file that run that script:

Picture wrong positioning Draft mode, correct positioning

share|improve this question
1  
I cannot see any problem with XeLaTeX under Linux. Make a screenshot of what you see. By the way: testing examples by yourself maybe a good idea ... ;-) –  Herbert Jun 4 '13 at 10:35
    
Welcome to TeX.SX! You can have a look on our starter guide to familiarize yourself further with our format. –  Heiko Oberdiek Jun 4 '13 at 10:39
    
I've added a missing directive (\end{figure}) in order to make your example compilable. Incidentally, what are the natural sizes of the images in figure1.eps and figure2.eps? If they're the same, then your example code does not create the problem issue you're looking to fix. –  Mico Jun 4 '13 at 10:39
1  
I can reproduce the problem: clipping of eps files doesn't give the same result as with dvips or dvipdfmx or as in TL12 (which all give the same result as the clipping of a pdf). In TL13 the result is defective too. There the graphics is somehow outside its frame. miktex just updated xetex.def so this is probably the source of the problem. I tested with tiger.eps instead of the figures in the example. –  Ulrike Fischer Jun 4 '13 at 10:48
    
Maybe related: the thread "eps inclusion by dvipdfmx and xdvipdfmx" in mailing list for TeX Live last month. –  Heiko Oberdiek Jun 4 '13 at 10:55
show 3 more comments

1 Answer

up vote 6 down vote accepted

The deplacement of your images looks like the result I get with TL13 but not like my output with miktex. Nevertheless try if it works if you add this your preamble (after loading graphicx):

\makeatletter
\def\Ginclude@eps#1{%
 \message{<#1>}%
  \bgroup
  \def\@tempa{!}%
  \dimen@\Gin@req@width
  \dimen@ii.1bp%
  \divide\dimen@\dimen@ii
  \@tempdima\Gin@req@height
  \divide\@tempdima\dimen@ii
    \special{PSfile="#1"\space
      llx=\Gin@llx\space
      lly=\Gin@lly\space
      urx=\Gin@urx\space
      ury=\Gin@ury\space
      \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
      \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
      \ifGin@clip clip\fi}%
  \egroup}
\makeatother

(This is the older definition of \Ginclude@eps.)

share|improve this answer
    
Great, it is excellent!! It works perfectly. So, just a further comment, can I expect they will correct the xetex package in the future? Can we consider it a bug? –  L. B. Jun 4 '13 at 14:39
    
"They" will correct the problem if someone notifies them. So make a bug report. –  Ulrike Fischer Jun 4 '13 at 14:50
    
@UlrikeFischer Did you report this? –  Joseph Wright Aug 24 '13 at 8:45
    
@JosephWright: No, I asked the OP to do it. (also I didn't follow if there were graphicx updates in the various system - I was more interested in the textfont error message). –  Ulrike Fischer Aug 24 '13 at 11:11
    
OK, this seems to be linked to tug.org/pipermail/tex-live/2013-May/033670.html. I guess what needs to happen is to get some tests sorted: I'll look at it. –  Joseph Wright Aug 24 '13 at 15:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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