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 running in a bizar problem with \spy: it does not spy there where I specify. To illustrate the problem, here is my simple code:

\listfiles             % not relevant, just shows my setup
   spy using outlines={circle, magnification=1, size=1cm, connect spies}]

   \fill [gray] (0,0) rectangle (2,3);
   \spy on (1,1.5) in node at (-2,1);

I run xelatex spy.tex on my MacOS (Snow Leopard)

This is XeTeX, Version 3.1415926-2.3-0.9997.5 (TeX Live 2011) 
restricted \write18 enabled.
entering extended mode
LaTeX2e <2009/09/24>
Preview: Fontsize 10pt
Preview: PDFoutput 1
ABD: EveryShipout initializing macros
Preview: Tightpage -1864679 -1864679 1864679 1864679
[1] (./spy.aux)

 *File List*
standalone.cls    2011/04/07 v0.4a Class to compile TeX sub-files standalone
kvoptions.sty    2010/12/23 v3.10 Keyval support for LaTeX options (HO)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
 ltxcmds.sty    2011/04/18 v1.20 LaTeX kernel commands for general use (HO)
kvsetkeys.sty    2011/04/07 v1.13 Key value parser (HO)
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/message (HO)
etexcmds.sty    2011/02/16 v1.5 Prefix for e-TeX command names (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size10.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
standalone.cfg    2011/04/07 v0.4a Default configuration file for     'standalone' 
 preview.sty    2010/02/14 11.86 (AUCTeX/preview-latex)
    tikz.sty    2010/10/13 v2.10 (rcs-revision 1.76)
     pgf.sty    2008/01/15 v2.10 (rcs-revision 1.12)
  pgfrcs.sty    2010/10/25 v2.10 (rcs-revision 1.24)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
 pgfcore.sty    2010/04/11 v2.10 (rcs-revision 1.7)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
   xetex.def    2009/11/22 v0.94 LaTeX color/graphics driver for XeTeX (RRM/JK)

  pgfsys.sty    2010/06/30 v2.10 (rcs-revision 1.37)
pgfsyssoftpath.code.tex    2008/07/18  (rcs-revision 1.7)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
pgfcomp-version-0-65.sty    2007/07/03 v2.10 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v2.10 (rcs-revision 1.1)
  pgffor.sty    2010/03/23 v2.10 (rcs-revision 1.18)

and eventually I'm getting image


I noticed that there is something wrong with the "border", cause I can "move" the spying location by setting a different border. A border of "2.1cm" for example renders into image


share|improve this question
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. – Tobi Jun 15 '12 at 17:08
As new user without image posting privileges simply include the image as normal and remove the ! in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the ! to turn it into an image again. – Tobi Jun 15 '12 at 17:08
It works fine with pdflatex for me, but using xelatex I get the same behaviour as described by the OP. – Jake Jun 15 '12 at 17:12
And with article in place of standalone, I get an empty left circle. – egreg Jul 12 '12 at 13:25
coincidentally I think the answer I just gave in a different question probably applies: tex.stackexchange.com/questions/62953/… – kgr Jul 12 '12 at 13:38

It appears that there is a bug in spy that affects xelatex and dvips (but not pdflatex). As far as I can tell this bug isn't fixed in any released version of pgf, but it does appear to be fixed in CVS, so your best bets may be to install the development version, or compile using pdflatex if possible. More details in this answer.

share|improve this answer

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.