You can use the \substack
command from the amsmath
package, like this:
\begin{equation}
d(\vec{x},\vec{y}) =
\sum_{\substack{Z_{xy}\in\vec{Z}_{xy}\\
\forall x\in\vec{x}\\
\forall y\in\vec{y}}}
f(Z_{xy})
\end{equation}
However, the result still doesn’t look good, because of the extra spacing around the sum symbol:
To fix this, you can use the \mathclap
command from the mathtools
package, like this:
\begin{equation}
d(\vec{x},\vec{y}) =
\sum_{\mathclap{\substack{Z_{xy}\in\vec{Z}_{xy}\\
\forall x\in\vec{x}\\
\forall y\in\vec{y}}}}
f(Z_{xy})
\end{equation}
But perhaps you might be happy using only \mathclap
, and not \substack
. The result looks good as long as the subscript is not too wide.
\begin{equation}
d(\vec{x},\vec{y}) =
\sum_{\mathclap{{Z_{xy}\in\vec{Z}_{xy},
\forall x\in\vec{x},
\forall y\in\vec{y}}}} f(Z_{xy})
\end{equation}
The mathtools
package also have several other useful commands for typesetting mathematics, including more commands for improving the display of subscripts and superscripts. I very much recommend taking a look at its documentation.
Use \hbox
within \vcenter
:
\vcenter{\hbox{\includegraphics{filename}}}
You could add \vcenter{\hbox{...}}
to your macro definition if you always use it vertically centered.
Btw. generally you could simply use additional braces instead of \mathord
to get the normal spacing.
Best Answer
It won't scale nicely with font size, but a simple approach is straightforward. The image should have a tight bounding box, which you can achieve with tools like pdfcrop.
\mathord
is suitable for ordinary symbols, since you indicated that it would be used similarly as\alpha
.With the suggestions from the comments, I wrote a better solution.
The symbol scales like a capital X for subscript and subsubscripts.