Graphics, Figures & TablesProblem with Tikz

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Christoph86
Posts: 1
Joined: Sat May 03, 2014 5:17 pm

Problem with Tikz

Post by Christoph86 »

Hi!

I have a tikz graphics which uses a shadow effect. After compiling the PDF everything is fine.

However, when I include this PDF in another latex document using \includegraphics or \includepdf, the shadow effect is gone. At least it misses sometimes in Ubuntu/Evince and in Preview under OS X, while Adobe Reader under Windows displays it correctly. Under OS X the Effekt is missing only "sometimes". Recompiling the document several times seems to resolve the problem every now and then.

The following example reproduces the problem:

Code: Select all

\documentclass{article}
\usepackage[table]{xcolor}
\usepackage[english]{babel}


\usepackage{tikz}
\pgfrealjobname{l}
\usetikzlibrary{shapes,arrows,backgrounds,chains,%
    matrix,patterns,arrows,decorations.pathmorphing,decorations.pathreplacing,%
    positioning,fit,calc,decorations.text,shadows,fadings,shadows.blur,decorations.markings%
}


\begin{document}
    

    \beginpgfgraphicnamed{logo}
    \begin{tikzpicture}
        \newdimen\R
        \R=0.6cm


        \tikzstyle{hexagon} = [
            shade,
            blur shadow={shadow blur steps=10},
            top color=white,
            bottom color=blue!10
        ];


        \draw [style=hexagon] (240:\R) -- (300:\R) -- (360:\R) -- (60:\R) -- (120:\R) -- (180:\R) -- (240:\R) -- (300:\R) node (hex) {} ;
    \end{tikzpicture}
    \endpgfgraphicnamed


\end{document}
As the filename suggests, the graphics is a logo which should be included in several other documents. Therefore, copying the code directly into the tex file which should include the graphics is not really an option.

I suppose the problem is due to different layers in the logo PDF.

Has anyone an idea how I could solve the problem?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

feuersaenger
Posts: 34
Joined: Sun Oct 16, 2011 5:56 pm

Re: Problem with Tikz

Post by feuersaenger »

Hi,

the fact that Acrobat Reader displays it correctly indicates a bug in the other viewer(s).

Evince, in particular, appears to be buggy sometimes, especially with some shadings (and your shadow is a shading unless I am mistaken).

From what I remember, the previewer uses the same code base as evince and suffers the very same bugs.

I would suggest to file bug tickets for evince and perhaps Mac OS and assume that your pdf is ok. The fact that acrobat appears to be display you document should be a "reasonable" reference that it is intact.

Regards

Christian
Post Reply