9

As soon as I load the package svg, tikz does not handle opacity any longer.

Here, an example:

\documentclass{article}
\usepackage{tikz} 
\usepackage{svg} 
\begin{document}
\begin{tikzpicture}
\draw[fill=green] (0,0) circle (1cm);
\draw[fill=red,opacity=0.5] (1,0) circle (1cm);
\end{tikzpicture}
\end{document}

This will yield:

wrong

Without \usepackage{svg}, opacity will be displayed correctly:

correct

In the log file, the following package versions are listed:

  • everyshi 2001/05/15 v3.00
  • pgfrcs 2013/12/20 v3.0.0
  • pgf 2013/12/18 v3.0.0
  • graphicx 1999/02/16 v1.0f
  • keyval 1999/03/16 v1.13
  • graphics 2009/02/05 v1.0o
  • trig 1999/03/16 v1.09
  • infwarerr 2010/04/08 v1.3
  • ltxcmds 2011/11/09 v1.22
  • pgfsys 2013/11/30 v3.0.0
  • xcolor 2007/01/21 v2.11
  • pgfcore 2010/04/11 v3.0.0
  • pgfcomp-version-0-65 2007/07/03 v3.0.0
  • pgfcomp-version-1-18 2007/07/23 v3.0.0
  • pgffor 2013/12/13 v3.0.0
  • tikz 2013/12/13 v3.0.0
  • pdftexcmds 2011/11/29 v0.20
  • ifluatex 2010/03/01 v1.3
  • ifpdf 2011/01/30 v2.3
  • epstopdf-base 2010/02/09 v2.5
  • grfext 2010/08/19 v1.1
  • kvdefinekeys 2011/04/07 v1.3
  • kvoptions 2011/06/30 v3.11
  • kvsetkeys 2012/04/25 v1.16
  • etexcmds 2011/02/16 v1.5

If \usepackage{svg} is loaded, the log file includes also:

  • svg 2012/09/05 v1.0
  • xkeyval 2012/10/14 v2.6b
  • subfig 2005/06/28 ver: 1.3
  • caption 2013/05/02 v3.3-89
  • caption3 2013/05/02 v1.6-88
  • import 2009/03/23 v 5.1
  • transparent 2007/01/08 v1.0
  • auxhook 2011/03/04 v1.3

Thanks for any hints to solve this problem!

Rantanplan
  • 307
  • 2
  • 8

1 Answers1

8

Update

newer version of the transparent package avoid the clash and the work-around is no longer needed.

Old answer

The transparent package, loaded by svg, clashes with the tikz code for opacity. As a workaround you can try to suppress the loading of transparent:

\documentclass{article}
\usepackage{tikz}
\expandafter\def\csname ver@transparent.sty\endcsname{}
\usepackage{svg}
\begin{document}
\begin{tikzpicture}
\draw[fill=green] (0,0) circle (1cm);
\draw[fill=red,opacity=0.5] (1,0) circle (1cm);
\end{tikzpicture}
\end{document}
Ulrike Fischer
  • 327,261
  • 1
    Since version 2.00 of svg, the loading of transparent can also be disabled with the svg package option notransparent (or usetransparent=false). – schtandard Apr 18 '18 at 17:30