8

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!

  • 3
    transparent is the source of the problem. – Ulrike Fischer Apr 29 '15 at 12:29
  • This is very odd. The opacity works with me, but it stops working if I change the document class to standalone. – Alenanno Apr 29 '15 at 13:13
  • @ulrike Is there a way to force the svg package not to load the transparent package? – Rantanplan Apr 29 '15 at 15:08
  • @john I tried to load xcolor before loading tikz and svg, but it does not do any difference. – Rantanplan Apr 29 '15 at 15:08
  • 4
    You can use \expandafter\def\csname ver@transparent.sty\endcsname{} before loading svg. But I have no idea if svg needs transparent.sty. – Ulrike Fischer Apr 29 '15 at 15:24
7

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.