Graphics, Figures & Tablespdflatex, tikz, transparency

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
nukular
Posts: 2
Joined: Thu Jul 30, 2009 9:25 pm

pdflatex, tikz, transparency

Post by nukular »

I am using ktikz (on linux) to generate the following with transparency and it works but when I include it in a larger document and process it with pdflatex and view it with evince, there is no tranparency. The error from evince is "ExtGState 'pgf@ca0.5' is unknown" and Acrobat reader on Windows pukes on it as well. Is this a bug or am I doing something wrong, as the Venn example from http://www.texample.net/tikz/examples/ works with pdflatex?

Code: Select all

\usetikzlibrary{snakes,calc,positioning,backgrounds}

\begin{tikzpicture}[font=\small,scale=2.75]
\draw [thick] (-0.1,0.275) -- +(15:1.5);
  \draw (0,0) -- (15:2);
\draw [very thin,densely dashed] (0,0)--(1.93,0);
\draw [densely dotted] (0.75,0) arc (0:15:0.75);
\draw (0.9,0.12) node {$\theta$};
\shadedraw [outer color=black,shading=radial] (0.3,0.215) circle (0.125);
\draw [fill=white,white] (0.3,0.215) circle (0.05);
\shadedraw [outer color=black,shading=radial] (0.65,0.305) circle (0.125);
\draw [fill=white,white] (0.65,0.305) circle (0.05);

\begin{scope}[semitransparent,line after snake=0pt, segment aspect=0.1,segment length=8.6pt,color=blue,segment amplitude=1pt]
\fill [decoration={coil}]
  [fill=blue!20,draw=blue!20,thin] (0,0) -- +(15:1.25)  decorate{to (-215:0.5)}  -- (-0.41,0) -- cycle;
\end{scope}

\end{tikzpicture}

Recommended reading 2024:

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

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

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

pdflatex, tikz, transparency

Post by gmedina »

Hi,

I compiled your code (after suitable completion) and got no errors. However, I got the following warning:
Package tikz Warning: Snakes have been superseded by decorations. Please use the decoration libraries instead of the snakes library on input line 14.
This suggests that perhaps you are using an old version of TikZ. You could try upgrading your TikZ version, and changing your code accordingly.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

pdflatex, tikz, transparency

Post by localghost »

gmedina wrote:[...] This suggests that perhaps you are using an old version of TikZ. You could try upgrading your TikZ version, and changing your code accordingly.
It's right the other way round. The code sample is an older one. It has to be adapted to the new version of pgf/tikZ. The detail is in the snakes library, which is now obsolete and should be replaced with the decorations.pathmorhing library. The manual (Section 27.2 - Path Morphing Decorations, p. 258ff) shows how to adapt the code.


Best regards
Thorsten
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

pdflatex, tikz, transparency

Post by gmedina »

localghost wrote:
gmedina wrote:...It's right the other way round. The code sample is an older one. It has to be adapted to the new version of pgf/tikZ. The detail is in the snakes library, which is now obsolete and should be replaced with the decorations.pathmorhing library...
Well, that's exactly what I meant in my response.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
nukular
Posts: 2
Joined: Thu Jul 30, 2009 9:25 pm

Re: pdflatex, tikz, transparency

Post by nukular »

Thanks all, that worked.
[Edited]
Spoke too soon. It appears that the problem is some sort of clash with the combine class. I am combining a number of different documents and it appears that if the document is the first one with a tikz diagram it works fine but if there is another document that gets input before it which contains a tikz diagram it will then throw the "Error: ExtGState 'pgf@ca0.5' is unknown" error. I'll test it more to see if I can narrow down the problem.
Post Reply