Closed grogorick closed 7 months ago
Always provide a small but complete example and use images that are available (You can use example-image.pdf and example-image.png).
I can not confirm that it doesn't work:
\documentclass{article}
\usepackage{graphicx}
\usepackage{transparent}
\begin{document}
x\rlap{XXXXXXXXXXXXXXXXXXXXXXXXX}%
\includegraphics[width=5cm]{example-image-a}
x\rlap{XXXXXXXXXXXXXXXXXXXXXXXXX}%
\texttransparent{0.5}{\includegraphics[width=5cm]{example-image-a}}
x\rlap{XXXXXXXXXXXXXXXXXXXXXXXXX}%
\texttransparent{0.5}{\includegraphics[width=5cm]{example-image-a.png}}
\end{document}
gives
Thx for your quick reply and sorry for the incomplete example.
I'm actually getting the same error when using your code (on Overleaf, if that matters). Maybe it's an issue with some opacity props within the PDF? I'm using the following: age_distribution_bar.pdf age_distribution_bar.png
on overleaf my example didn't work at all as it should be example-image-a
and not example-image-A
, but apart from this it transparency is fine. And yes, your PDF contains its own opacity settings and so they win. There is nothing the transparent package can do about it.
It seems to have no effect when including PDFs as images, e.g. this does not work:
\transparent{0.5}\includegraphics{figures/fig1.pdf}}
while this works:\transparent{0.5}\includegraphics{figures/fig1.png}}
To provide some context, I usually include vector images in PDF format.