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.

The example in this answer, illustrating the use of "spies" using the Tikz package, fails to typeset correctly when using XeLaTeX: the magnification circle appears empty. Using pdfLaTeX and LaTeXmk works fine, otherwise.

Do I need to configure my TeX distribution somehow in order to typeset TikZ code using XeLaTeX? (Currently using MacTex 2011 with TeXworks, on OS X Lion.)

share|improve this question

1 Answer 1

There indeed seems to be a problem with the use of "spies" under XeLaTeX. Consider the following MWE, which is a stripped-down version of the answer referred to by the OP:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{spy}
\pagestyle{empty}
\begin{document}
\begin{figure}
\begin{tikzpicture} 
  [spy using outlines={circle, magnification=4, 
   size=1cm, connect spies}]
\draw[help lines] (0,0) grid (2,2);
\draw[red] (0,0) -- (1,1);
\spy [blue] on (1,1) in node at (1.75,2.75);
\end{tikzpicture}
\end{figure}
\end{document}

When compiled under pdflatex, the following figure results:

enter image description here

In contrast, when the same program is compiled under XeLaTeX, one gets:

enter image description here

I.e., both the "cross-hairs" and the red line that terminates in the middle of the "target" aren't shown inside the spy-circle. :-(

share|improve this answer
    
add the command and it doesn't work. –  Pig Cry Nov 1 '11 at 2:47
1  
@PigCry: Please be more specific regarding "it doesn't work". Which TeX distribution are you running, under which OS? Did you remove all aux files prior to recompiling under XeLaTeX? –  Mico Nov 1 '11 at 3:23
    
sorry for my curt comment. I use texlive 2011 not mactex, maybe that's the point. –  Pig Cry Nov 1 '11 at 6:41
1  
I add the command \usepackage{fontspec}, compile it under xelatex without error warning, but the magnification circle appears almost empty, only with a vertical. I think the vertical is a grid line. –  Pig Cry Nov 1 '11 at 9:01
2  
Seems to work fine for TikZ 3.0.0 –  someonr Jan 2 at 8:04

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.