# Included graphics in TiKZ with XeLaTeX get displaced

I have a problem with \includegraphics within TikZ with XeLaTeX, namely that the images get displaced.

This is similar to the problem described in this question, but the symptoms are different. Moreover, this problem appeared when I switched from Ubuntu’s TeX Live to a manually installed minimalistic TeX Live 2019, which suggests that I may be missing some package or I made some mistake when installing (I haven’t tried a full installation yet). Note that no error or otherwise helpful message is thrown.

### Minimal example

It seems that any PDF image will cause the problem, but just so we are on the same page, I compile the following to obtain an image.pdf to use. (It doesn’t seem to matter whether I compile with pdflatex or xelatex.)

\documentclass{standalone}
\begin{document}
\Huge Here is some text.
\end{document}


The main file is:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\node{
\includegraphics[scale=1]{image.pdf}
};
\end{tikzpicture}
\end{document}


I compile this file once with xelatex (left) and once with pdflatex (right) and everything seems normal:

Now, I change the size of the image to scale=2:

And finally for scale=3, the included image has completely sailed off the page:

This problem vanishes when I remove the TikZ wrapper. What could be the reason for this and how can I fix it?

• What happens if you use mm instead of em as a unit? – Ulrike Fischer Jul 13 '19 at 15:42
• @UlrikeFischer: Not much, but using yet another unit made me discover something interesting: Please see my edit. – Wrzlprmft Jul 13 '19 at 17:55
• Hm. Interesting. It looks like a pgf bug, but needs some investigating. – Ulrike Fischer Jul 13 '19 at 18:40
• It is clearly a pgf bug in the newest version. Reverting to the previous one resolves the problem. I made a bug report github.com/pgf-tikz/pgf/issues/708 – Ulrike Fischer Jul 13 '19 at 18:59
• @UlrikeFischer: Thanks for finding that out. Now I just need to figure out how to obtain and install the last version of PGF … – Wrzlprmft Jul 13 '19 at 20:50