# includegraphics inside a TikZ node with XeLaTeX is incorrectly positioned when width or height is given [closed]

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};
\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).

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

Note that the following are related:

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.

-

## closed as off-topic by Loop Space, Peter Jansson, Martin Schröder, Benedikt Bauer, barbara beetonNov 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.

works for me with a tL2013 updated today –  David Carlisle Aug 16 '13 at 22:38
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
This has now been fixed in the CVS version of PGF. –  Loop Space Nov 10 '13 at 20:36