I encounter a strange error with synctex when the shadows tikz library is included. Everything works fine, except the reverse search on page 1 of the pdf. Clicking on the first page gets me to pgflibraryfadings.code.tex.
I use evince and latexila on Arch (but the same problem occurs with other editors).
Here is a minimal example to reproduce the problem. Compile the following tex code with pdflatex and when you then do a reverse search on the resulting pdf document synctex will open pgflibraryfadings.code.tex
Same here, with TexStudio and internal pdf viewer
The problem seems to be ultimately in the file
/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.defand there in the definitions of the macros\pgfsys@horishading,\pgfsys@vertshading, and\pgfsys@radialshading. In these macros there is some stuff written directly to the PDF file via\immediate\pdfxform, which seems to confusesynctex. If you remove the\immediatethe problems with synctex are gone and the fadings still seem to work (however, I don't know what other effects this may have...)See also: http://tex.stackexchange.com/questions/99526/bug-in-pgfplots-or-other-packages
Imho this is caused by a long standing bug in synctex in combination with \pdfrefxform.
http://tug.org/pipermail/pdftex/2009-May/008027.html
I asked on the texlive list, and Karl Berry wrote, he will look into it.
It seems Ulrike was right and the bug was in Synctex and not TikZ. At least for me Gustav's MWE is working fine.
Last edit: Stefan Pinnow 2018-12-21