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:

And here's the code:

\documentclass[tikz]{standalone}

\begin{document}
\begin{tikzpicture}

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

\end{tikzpicture}
\end{document}


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'
class
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)
pgfrcs.code.tex
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
e/RRM/JK)
pgfsys.sty    2013/11/30 v3.0.0 (rcs-revision 1.47)
pgfsys.code.tex
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
pgfcore.code.tex
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)
pgfkeys.sty
pgfkeys.code.tex
pgfmath.sty
pgfmath.code.tex
pgffor.code.tex
tikz.code.tex


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

• 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:

\documentclass{article}
\pagestyle{empty}
\usepackage{tikz}
\newenvironment{out}{%
\begin{lrbox}{0}%
\ignorespaces
}{%
\ifhmode\unskip\fi
\end{lrbox}%
\pdfpagewidth=\wd0 %
\pdfpageheight=\dimexpr\ht0+\dp0\relax
\shipout\vbox{\kern-1in\hbox{\kern-1in\copy0}}%
}

\begin{document}
\begin{out}
\begin{tikzpicture}
\shade[bottom color=blue!50!black, top color=cyan!50] (-1,-1) rectangle (1,1);
\end{tikzpicture}%
\end{out}
\end{document}


• 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