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

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

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:

  [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);

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
@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
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
Seems to work fine for TikZ 3.0.0 – someonr Jan 2 '14 at 8:04

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.