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

We are all familiar with MetaPost labels:

label.top(btex $a_t$ etex, z0);

The problem with the above is that the positioning is based on the entire label, including the subscript.

How do I calculate the positioning based on the baseline of the text, i.e. only the "a" part, and not the "t" subscript?

share|improve this question
up vote 3 down vote accepted

Smash the box:

label.top(btex \setbox0=\hbox{$a_t$}\dp0=0pt \box0 etex, z0);

However this will ignore the depth when computing the bounding box, so you may have to add something to it if the label is near the bottom of the image.

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.