TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to use a small image in an equation, where a symbol like \alpha might otherwise be. Is there a nice way to do this?

share|improve this question
I have never tried \includegraphics in math mode, but I would expect it to work. Are you saying it doesn't? Or is it that you have some difficulty with vertical alignment (which I imagine could become problematic)? – Harald Hanche-Olsen Feb 14 '11 at 16:33
up vote 15 down vote accepted

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.

share|improve this answer
Use height=1em, then the picture can be auto scaled. – Leo Liu Feb 14 '11 at 16:42
@Leo Liu: It should, but it didn't work in my tests: $ \mysymbol_{\mysymbol_{\mysymbol}} $ gives 3x the same size with 1em or similar. – Martin Scharrer Feb 14 '11 at 16:57
@Martin: Use \mathchoice then. I used this trick in my own document years ago. – Leo Liu Feb 14 '11 at 17:01
I would suggest 1.6ex instead, which is about the height of an uppercase X. The 1em is actually the width of an uppercase M. – Martin Scharrer Feb 14 '11 at 17:01
I have incorporated all your comments to an improved solution. – Mikael Öhman Feb 14 '11 at 17:15

Yes, you can. There is nearly no difference between a image and a symbol. Just define a command for convenience. You can also use PSTricks or TikZ to draw such a symbol.

However, you may need to redefine the depth of the box, and refine the spacing using \mathbin etc.

A full example (suppose a logo.pdf exists):

\def\logo{{% mathord
share|improve this answer
It seems I'm too obstinate to use ex. :) – Leo Liu Feb 14 '11 at 17:30

Mikael and Leo both gave good answers so I won't repeat that information.

If you need the image centered with respect to binary operators, fractions, and the like, then you can use \vcenter{...} to perform that vertical centering.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.