I would be extremely grateful to get some help with this following problem:
I would like to have following outcome:
Where the grey box is all the way out in the margin, but the image and the rest of the text in the document has a specific margin. I would also like to include a listing of text in the colored box.
Closest I can get is this:
\noindent
\fcolorbox{MyGray2}{MyGray2}{\parbox{\paperwidth-3.0\fboxsep-3.0\fboxrule}{\includegraphics[scale=0.1, left=5in]{cvbild.jpg}}{Hejhejhejhejhejhej akj kajhf kjhj hkdjfh skdjfh ksdjfg kdsg }}
However is the margin to the left still white and the text doesn't come even close to where I want it.
Another try was to make a \mybox
and change the margins just over the box, but then I get a new page before and after the box.
\newtcolorbox{mybox}{
arc=0pt,
boxrule=0pt,
colback=MyGray2,
% width=0.2\textwidth, % this option controls the width of the box
colupper=black,
fontupper=\bfseries
}
\begin{document}
\newgeometry{left=0in,right=0in} % set new margins
\nopagebreak[4] % doesn't work
\begin{mybox}
\includegraphics[scale=.1, left]{cvbild.jpg}{example varfö alajlkejf ksdf }
\end{mybox}
\restoregeometry % restore margins
Best Answer
One could use
tcolorbox
ormdframed
, for example, but this can also be done without those powerful packages using some boxes (for example, a\makebox
, a\parbox
of width equal to\paperwidth
, a\colorbox
and someminipage
s for the inner contents); something along these lines:The result: