1

Can anyone help me get an opacity scope to work correctly with pgf-umlcd inheritance relation?

\documentclass{minimal}
\usepackage{pgf-umlcd}

\begin{document}

\begin{tikzpicture}
   \begin{scope}[opacity=0.3]
      \begin{class}{Foo}{0, 2cm}
      \end{class}
      \begin{class}{Bar}{0, 0cm}
         \inherit{Foo}
      \end{class}
   \end{scope}
\end{tikzpicture}

\end{document}

Notice the inheritance relation doesn't get the reduced opacity.

Result2

  • I don't quite understand your use of transparency group here. Isn't just opacity what you need? \documentclass{minimal} \usepackage{pgf-umlcd} \begin{document} \begin{tikzpicture} \begin{scope}[opacity=0.5] \begin{class}{Foo}{0, 2cm} \end{class} \begin{class}{Bar}{0, 0cm} \inherit{Foo} \end{class} \end{scope} \end{tikzpicture} \end{document} – Gonzalo Medina Sep 12 '15 at 21:38
  • Indeed. Edited question and made the resulting image more clear. – William Sep 12 '15 at 21:59
1

It's not entirely clear to me why this happens, but there are a couple of workarounds. One is to append the opacity setting to the umlcd style inherit line style in addition, another is to use every path/.append style={opacity=0.3}.

output of code

\documentclass{article}
\usepackage{pgf-umlcd}

\begin{document}

\begin{tikzpicture}
   \begin{scope}[
      %opacity=0.3,umlcd style inherit line/.append style={opacity=0.3},
      every path/.append style={opacity=0.3}
     ]
      \begin{class}{Foo}{0, 2cm}
      \end{class}
      \begin{class}{Bar}{0, 0cm}
         \inherit{Foo}
      \end{class}
   \end{scope}
\end{tikzpicture}
\end{document}

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.