2

I am trying to use the 'transparent' package, as shown in this answer:

\documentclass{article}
\usepackage{color}
\usepackage{transparent}
\begin{document}
  \colorbox{red}{%
    Black text in a red box %
    \transparent{1.0}%
    \colorbox{blue}{%
      and now a blue box is added%
    }
  }

  \colorbox{red}{%
    Black text in a red box %
    \transparent{0.5}%
    \colorbox{blue}{%
      and now a transparent blue box is added%
    }
  }
\end{document}

But it seems not to work with current TeX or pdflatex. Is there an approach that works with pdflatex?

enter image description here


Edit: After compiling a few times (from TeXMaker), suddenly I can see the tranparency, although I did not change the .tex file nor the pdflatex command. Is this a bug?

Emit Taste
  • 4,404

1 Answers1

3

From the transparent manual:

2.3 Transparency The setting for the different transparency values must be added to the page resources. In the first run the values are recorded in the .aux file. In the second run the values are set and transparency is available.

This means, that the first run writes information to the .aux and the second run grabs those values and sets the whole feature up.

Compile twice

enter image description here