I would like to have a figure that overlays a transparent png on top of a pdf. What is the best way to composite images inside a LaTeX figure? I would like to avoid compositing these images using separate image editing software beforehand, if possible.
1 Answer
According to Section 12 in Using Imported Graphics in Latex and pdfLatex by Keith Reckdahl, 2006:
\makebox[0pt][l]{\includegraphics{firstgraphic}}%
\includegraphics{secondgraphic}
stackengine
package provides\stackinset{l,c,r}{h-offset}{t,c,b}{v-offset}{inset image}{base image}
to allow relative placement of the inset to be configured. Thel,c,r
is either left, center or right alignment, whilet,c,b
is either top, center, or bottom alignment. The offsets move the inset relative to the alignment.