[Tex/LaTex] Vertically center text and image in one line

graphicsvertical alignment

I need to place an icon and text behind each other on one line. The icon is higher than a single text line, and would like to have the icon and text center aligned. How do I do that?

Best Answer

The only way I found to do this robustly (well, Scott showed me this...) is to put the figure in a math matrix:

\documentclass{article}
\usepackage{graphics}
\begin{document}
hello here is $
\begin{array}{l}
\includegraphics{icon}
\end{array}
$ my line.
\end{document}

resulting in alt text