I have a question about a piece of code the moderator Martin Scharrer posted some time ago (so if you're there Martin, this one is for you). The question he was answering to was about using an image as the background of a minipage
.
He posted this solution
\documentclass{article}
\usepackage{graphicx}
\newsavebox\mysavebox
\newenvironment{imgminipage}[2][]{%
\def\imgcmd{\includegraphics[width=\wd\mysavebox,height=\dimexpr\ht\mysavebox+\d p\mysavebox\relax,#1]{#2}}%
\begin{lrbox}{\mysavebox}%
\begin{minipage}%
}{%
\end{minipage}
\end{lrbox}%
\sbox\mysavebox{\fbox{\usebox\mysavebox}}%
\mbox{\rlap{\raisebox{-\dp\mysavebox}{\imgcmd}}\usebox\mysavebox}%
}
\begin{document}
\begin{imgminipage}{imagefilename}{5cm}
Some text\\
Hello world!
\end{imgminipage}
\end{document}
When I use this code, however, the minipage
has a black frame around the image. How can I modify it to get rid of the frame?
\fbox
with\mbox
.\fbox
is for frame box. – Guido Dec 5 '16 at 20:03