This is the second time it's happening and the first time it went away by itself, so this time I thought that it was a matter of rebooting my system, or maybe an issue with the default PDF viewer. None of those fixed it, so I'm asking here not only because someone might know the solution but also because it sets a precedent.

Also, my Tex Live is up to date. Switching between XeLaTeX and pdflatex yields no different results.

Basically applying a shading/path fading to any given shape (which one seems to be irrelevant), the result will always be a rectangle on the bottom of the shaded shape filled with the top colour. Here's an example:

figure 1

And here's the code:



\shade[bottom color=blue!50!black, top color=cyan!50] (-1,-1) rectangle (1,1);


What is wrong with it?

Edit: Now pdflatex gives the expected result, but XeLaTeX still shows the problem. Also, here is the result of \listfiles

 *File List*
standalone.cls    2012/09/15 v1.1b Class to compile TeX sub-files standalone
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
 xkeyval.sty    2014/12/03 v2.7a package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
standalone.cfg    2012/09/15 v1.1b Default configuration file for 'standalone' 
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
    tikz.sty    2013/12/13 v3.0.0 (rcs-revision 1.142)
     pgf.sty    2013/12/18 v3.0.0 (rcs-revision 1.14)
  pgfrcs.sty    2013/12/20 v3.0.0 (rcs-revision 1.28)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
 pgfcore.sty    2010/04/11 v3.0.0 (rcs-revision 1.7)
graphicx.sty    2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2014/10/28 v1.0p 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    2015/03/25 v4.04 LaTeX color/graphics driver for XeTeX (TeX Liv
  pgfsys.sty    2013/11/30 v3.0.0 (rcs-revision 1.47)
pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)
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 v3.0.0 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v3.0.0 (rcs-revision 1.1)
  pgffor.sty    2013/12/13 v3.0.0 (rcs-revision 1.25)

marked as duplicate by Heiko Oberdiek, user13907, moewe, Martin Schröder, R. Schumacher Jun 10 '15 at 20:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Works fine for me with pdflatex, but xelatex gives the same image as in your screenshot. Imho xelatex can't handle shading. – Ulrike Fischer Jun 10 '15 at 17:17
  • Strange. I get what you would expect: a rectangle filled with cyan a the top and then gradually changing to dark blue at the bottom. Perhaps post the output of \listfiles? – Andrew Jun 10 '15 at 17:17
  • @UlrikeFischer Now I'm having your result. (Of course, I don't know why this is happening). – Alenanno Jun 10 '15 at 17:24
  • @Andrew Sure. Posting it. – Alenanno Jun 10 '15 at 17:24
  • @UlrikeFischer By the way, it has been working until today also on XeLaTeX. So this is very weird, and annoying because I needed XeLaTeX in this instance. – Alenanno Jun 10 '15 at 17:27

The problem seems to be related to class standalone or package preview. The following example works around by using the standard class article:

  \pdfpagewidth=\wd0 %

\shade[bottom color=blue!50!black, top color=cyan!50] (-1,-1) rectangle (1,1);


  • Yeah, but I needed it with xelatex, because I'll be setting fonts (CJK) later in the process. Is there a workaround to do the same thing with similar commands in pdflatex? That would be a good temporary solution until the problem is hopefully fixed. – Alenanno Jun 10 '15 at 18:45
  • @Alenanno The test file works for both xelatex and pdflatex. \pdfpagewidth and \pdfpageheight are also known in XeTeX. – Heiko Oberdiek Jun 10 '15 at 19:36
  • Oh, didn't see it. Sorry and thanks. I'll accept your answer. I opened a ticket to bump the issue. :) – Alenanno Jun 10 '15 at 19:40
  • @Alenanno Ulrike found the duplicate. There is the answer of Christian Feuersänger, where he writes, that the problem is already fixed in the CVS version. – Heiko Oberdiek Jun 10 '15 at 19:40
  • What is the CVS version? I did see the answer but it's still occurring. – Alenanno Jun 10 '15 at 19:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.