I have defined a new environment that I use to highlight warnings in my text. Here's a minimal example of the code I use:
\documentclass[parskip]{scrartcl}
\usepackage{fourier} % for the bomb
\usepackage{lipsum}
\newenvironment{warning}{%
\begin{minipage}[t][\height][c]{0.12\textwidth}%
{\Huge{\bomb}}%
\end{minipage}%
\begin{minipage}[t]{0.88\textwidth}
\begin{sloppypar}%
}{%
\end{sloppypar}%
\end{minipage}%
\hspace{-\parfillskip}%
}
\begin{document}
\lipsum[1]
\begin{warning}
\lipsum[2]
\end{warning}
\lipsum[3]
\begin{warning}
This is just a short warning.
\end{warning}
\lipsum[4]
\end{document}
This mostly works as intended, at least for longer warnings. If the text of the warning consists of only one or two lines, the vertical alignment of the text next to the symbol starts looking weird. If I change the vertical alignment of the minipages from t to c, the overall spacing improves for the short warnings, but this also changes the longer warnings in what I consider a worse layout. I realize that I could solve this with two distinct environments for short and long warnings, but is there a way to automate this? Like if the contents of the right-hand column exceed a height of ..., use this alignment, else use the other one?
(I'll also accept pointers to packages that provide a similar highlighting in a more robust/professional/cool way :-))


\makeatletterand\makeatotherinstructions in this case? There aren't any@s in this code, or am I missing something? – vwegert Jul 17 '13 at 13:59@'s in the original code. I can put some, if you prefer. ;-) – egreg Jul 17 '13 at 14:01