[Tex/LaTex] Colored box with image and text, no margins

boxesmargins

I would be extremely grateful to get some help with this following problem:
I would like to have following outcome:

Wished 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 or mdframed, 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 some minipages for the inner contents); something along these lines:

\documentclass{article}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{lipsum}% just to generate filler text

\begin{document}

\lipsum[4]

\par\medskip
\noindent\makebox[\linewidth][c]{%
  \colorbox{gray!30}{%
    \parbox{\paperwidth}{%
      \hspace*{\dimexpr\hoffset+\oddsidemargin+1in\relax}%
      \begin{minipage}{.2\textwidth}
        \includegraphics[width=\linewidth,height=3cm]{example-image-a}
      \end{minipage}%
      \begin{minipage}{.05\textwidth}
        \mbox{}
      \end{minipage}%
      \begin{minipage}{.75\textwidth}
        Some other text\par\bigskip
        \begin{tabular}{@{}ll@{}}
        Email \\
        Phone \\
        Address
        \end{tabular}
      \end{minipage}%
    }%
  }%
}\par\medskip

\lipsum[4]

\end{document}

The result:

enter image description here