TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

\usepackage[margin = 0.5in]{geometry}


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


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.

share|improve this question
Remove \pgftext. – egreg Mar 7 '13 at 22:33
up vote 4 down vote accepted

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.

share|improve this answer
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

Your Answer


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.