# Vertical alignment of inline images

Images appearing inline aren't always ideally placed relative to the baseline and risers of the text itself, so I frequently find myself doing manual adjustment, by eye, using \raisebox{}{} with a negative first parameter.

My question is whether there is a simple way to get a comparable effect without adjusting the parameter manually against the output in each case.

-
What kind of inline images are you using in what kind of situations? Are you maybe use images for symbols? –  Martin Scharrer Apr 14 '11 at 21:15
Finishing typesetting a Manchu-English dictionary. The dictionary is in romanization, but in a few places it is useful to cite the original Manchu script. However, images of actual handwritten Manchu look better than the Manchu fonts (accessible though MonTex). –  brannerchinese Apr 14 '11 at 23:45

Note that \raisebox allows the use of \height, \depth, \width and \totalheight (=height+depth) which represent the original dimension of the to be raised box. As said, \depth is zero and so \totalheight is identical to \height for images. So if you want all you images to be 10% below the baseline you can use \raisebox{-.1\height}{\includegraphics[...]{...}}.
If you want the images to be as deep as the normal text you can use \dp\strutbox as a reference. The \strutbox contains the depth and height of a \strut. Both together are equal to \baselineskip so about 20% larger than the actual font size. Therefore you might want to use -.8\dp\strutbox. Alternatively you can use a font size relative length in ex. 1ex is about the height of an x.
Another comment: If you want top-aligned images in the figure environment, you can use \begin{figure}\raisebox{-\height}{\includegraphics{img1.png}}\qquad\raisebox{-\‌​height}{\includegraphics{img2.png}}\end{figure} –  yo' May 10 '12 at 16:34
@tohecz: In the meantime since my answer I published adjustbox which can export the valign key to \includegraphics. It allows for easy vertical alignment and uses the the same internal macros as \raisebox. –  Martin Scharrer May 10 '12 at 22:06