I try to create a box with a gray background color, where there is a centered image on the left and a text on the right side of the box. It should look like the boxes created in here. Here's a short reproducable example.
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}
\usepackage[T1]{fontenc}
\usepackage[table]{xcolor}
\definecolor{lightgray}{HTML}{f5f5f5}
\usepackage{adjustbox}
\usepackage{fontawesome}
\newenvironment{idea}
{%
\begin{adjustbox}{minipage=[b]
{380px},margin=1ex,bgcolor=lightgray,env=center}\faCoffee
}
{%
\end{adjustbox}%
}
\begin{document}
\begin{idea}
I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works.
\end{idea}
\begin{tabular}{p{1cm}p{11cm}}
\vspace{0.7em} \Huge \faCoffee & I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. \\
\end{tabular}
\end{document}
It's important that the box is created through \newenvironment.
I already tried to use a tabular but I have no idea how to integrate it into the adjustbox. The final result should look like the second example with the icon being centered and with gray background.
Any help is greatly appreciated!
UPDATE:
I played around a little and got a pretty hacky solution for this one case, but I need something more flexible. It should look like this though:
\renewcommand{\arraystretch}{1.5}
\newenvironment{warning}
{%
\begin{centering}
\begin{tabular}{p{0.1\linewidth}p{\linewidth}}
\rowcolor{lightgray} \vspace{0.5em} \hspace{0.7em} \Huge \faWarning &
}
{%
\end{tabular}
\end{centering}
}
\begin{warning}
I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works. I hope it works.
\end{warning}






