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.

Consider the following code:

\documentclass{article}
\usepackage{tikz}

\begin{document}

a\includegraphics[height=100pt]{example-image-10x16}b

\begin{tikzpicture}
\node[anchor=south west] at (0,0) {a\includegraphics[height=100pt]{example-image-10x16}b};
\fill[red] (0,0) circle[radius=.1];
\end{tikzpicture}
\end{document}

Run with pdflatex and it compiles just fine. Run with xelatex and the image in the node is displaced. It appears to be where the included graphic is located, since the a and b are always in the correct place. It also has something to do with the explicit height=100pt since removing that also fixes the problem (width=<something> also causes the problem to occur).

Displaced image

  1. What's happening?
  2. How can I make it stop?

Note that the following are related:

  1. Wrong positioning of images inside tikzpicture with XeLaTeX
  2. Switching from PDFLaTeX to XeLaTeX is messing with my pgftext coordinates

but I'm already in the situation of the answers given there.

Nor does the answer to Centering full-page Tikz image on page without margins with xelatex? work.


Edit: Following on from David and Harish's comments, I updated TL2013 and PGF. With the PGF that comes with TL2013 then it compiles correctly. With the CVS version of PGF then it does not. So the problem appears to lie with the PGF code for xelatex. I also discovered that the page changed from A4 paper (TL version of PGF) to letter paper (CVS version). As a Brit, my TL is set to produce A4 by default. Manually putting in a4paper changes the paper size back to A4, but doesn't correct the image displacement. So my guess is that the error is in PGF's driver file for XeTeX.

share|improve this question

closed as off-topic by Loop Space, Peter Jansson, Martin Schröder, Benedikt Bauer, barbara beeton Nov 10 '13 at 21:17

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

4  
works for me with a tL2013 updated today –  David Carlisle Aug 16 '13 at 22:38
1  
Strange. I get it right with miktex 2.9. –  Harish Kumar Aug 16 '13 at 22:38
    
Curiouser and curiouser ... I'm updating TL2013 and PGF as I type, will report back. –  Loop Space Aug 16 '13 at 22:50
    
Edited in the results of a bit of research ... –  Loop Space Aug 16 '13 at 23:36
5  
This has now been fixed in the CVS version of PGF. –  Loop Space Nov 10 '13 at 20:36

Browse other questions tagged or ask your own question.