I'm trying to create an alert box to show some info, with background color and an icon to the left. With the help of this question I've figured out to come up with this:
\documentclass[letterpaper,12pt,twoside]{report}
\usepackage{graphicx}
\usepackage{xcolor}
\definecolor{warningbackground}{RGB}{252,226,158}
\usepackage{floatflt}
\newcommand{\alertwarningbox}[1]{
\centering
\colorbox{warningbackground}{\parbox{400pt} {
\vskip 10pt
\begin{floatingfigure}[l]{50pt}
\includegraphics[scale=1.0]{AlertWarning.pdf}
\end{floatingfigure}
#1
\vskip 10pt
}
}
}
\newcommand{\alertwarning}[1]{
\vskip 10pt
\begin{floatingfigure}[l]{50pt}
\includegraphics[scale=1.0]{AlertWarning.pdf}
\end{floatingfigure}
#1
\vskip 10pt
}
\begin{document}
Text...
\alertwarning{
Warning message Warning message Warning message Warning message Warning message Warning message Warning message Warning message Warning message Warning message Warning message .
}
Text...
\alertwarningbox{
Warning message Warning message Warning message Warning message Warning message Warning message Warning message Warning message Warning message Warning message Warning message .
}
\end{document}

But, as you can see in the picture, when I put the picture and the text inside a colorbox, the content gets aligned to the right.
How can I center the box? Or What is correct way to do this task.

AlertWarning.pdfnot found ;) – yo' Oct 24 '13 at 19:14