# Positioning of image within an equation

I have the following problem: I would like to have images of Feynman diagrams as part of equations. Using

\newcommand{\imineq}[2]{
\includegraphics[height=#2ex]{#1}}

I had success in as far as

$$H\left(\imineq{Feynman_image}{7}\right)=$$

does put the image roughly where it's meant to be but shifted upwards to the top half of the brackets. Anyone have any ideas as to how I can get the image to appear vertically centered and ideally get the brackets to scale properly?

-
You can use \raisebox{-2ex}{\includegraphics...} to adjust the position, or perhaps simpler use the adjustbox package –  David Carlisle Nov 1 '12 at 15:10

In math mode there is the command \vcenter which will center material vertically. So you can set up your command as follows:

\documentclass{article}

\usepackage{mwe}

\newcommand{\imineq}[2]{\vcenter{\hbox{\includegraphics[height=#2ex]{#1}}}}

\begin{document}

$$a \left( \imineq{example-image-a}{4} \right) b$$

\end{document}

-
Thanks a lot, that did the trick! –  Ziegl Nov 4 '12 at 19:39