# Switching from PDFLaTeX to XeLaTeX is messing with my pgftext coordinates

I'm working on a template for an automated report (using knitr). I created a title banner for my organization using TikZ; the last step to finish the branding was to switch to my organization's fonts. For this, I switched to XeLaTeX--my first time using it. The fonts work great! But the position of the logo in my tikzpicture got messed up, and I can't seem to do anything with it.

Minimal Example:

\documentclass{article}
\usepackage[margin = 0.5in]{geometry}
\usepackage{graphicx}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\node at (1in, 1in) {\pgftext{\includegraphics[height=0.3in]{mylogo}}};
\node at (5in, 5in) {\pgftext{\includegraphics[height=0.3in]{mylogo}}};
\node at (2in, 2in) {First one};
\node at (3in, 3in) {Second one};
\end{tikzpicture}

\end{document}


When I run PDFLaTeX on the above code, everything works as expected: I see two logos, and both text nodes. If I run XeLaTeX, the normal text nodes still work as expected, but I only see one logo in the top left (I think they're both printed there). The question is: How can I position the image while using XeTeX?

The mylogo file is a .png, not that I can imagine that affecting anything. I'm running MiKTeX on a Windows box; I just ran the updater so everything should be up to date.

-
Remove \pgftext. –  egreg Mar 7 '13 at 22:33

## 1 Answer

I don't know what \pgftext is supposed to do, but it seems to be the problem. Removing it should put the logos where they should.

-
I got the \pgftext from this answer and never tried without it, but it does seem completely extraneous. –  Gregor Mar 7 '13 at 23:17
@shujaa \pgftext escapes back to "ordinary TeX" from the PGF environment. However, you're using inside a \node where you are already "escaped" back to TeX. Therefore it is superfluous and only good fortune meant that it had no effect with pdflatex! –  Loop Space Mar 8 '13 at 10:24