Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 2 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
add comment

Your Answer

 
discard

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.