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.

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.

share|improve this question
2  
Remove \pgftext. –  egreg Mar 7 '13 at 22:33

1 Answer 1

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
1  
@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

 
discard

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.