[Tex/LaTex] overpic absolute positioning for local figure only

overpic

I am trying to use overpic with absolute positioning for a single figure only. The \usepackage[abs]{overpic} sets absolute positioning for all figures. Is there a way to define it for the local overpic environment only? Or is there a way to load both absolute and relative versions of overpic and calling them differently?

Best Answer

As I suggested in my comment of 6 months ago, the \stackinset macro of the stackengine package provides this capability. You might consider it an alternative to overpic if you want positioning relative to the local figure.

\documentclass{article}
\usepackage{stackengine}
\usepackage{graphicx}
\usepackage{xcolor}
\begin{document}
\stackinset{l}{0.2cm}{t}{0.2cm}{\colorbox{white}{blackbird in the snow}}{%
\stackinset{r}{0.5cm}{t}{0.5cm}{\includegraphics[width=3cm]{blackbird.jpg}}{%
\includegraphics[width=\textwidth]{snow.jpg}%
}}
\end{document}

enter image description here

Related Question