[NTG-context] Alignment problem with labels and textext

Alan BRASLAU alan.braslau at cea.fr
Wed Feb 13 11:28:04 CET 2013

On Wed, 13 Feb 2013 11:11:23 +0100
Lutz Haseloff <lutz.haseloff at gmail.com> wrote:

> Hi Keith,
> following testfile perhaps describes my problem better:
> \starttext
> \startMPpage
> drawdot (origin);
> label.rt (textext("right") , origin) ;
> label.top (textext("top") , origin) ;
> label.lft (textext("left") , origin) ;
> label.bot (textext("bottom") , origin) ;
> \stopMPpage
> \stoptext
> If i run it by texexec(mkii), all is ok, with context(mkiv) the labels
> overlap.

I do not know what you expect exactly.
Each textext() label has a bounding box.
This bounding box is then aligned in the case of rt, top, lft, bot
with its appropriate edge centered at the origin.
The lft and rt text thus will not have their baselines aligned, unless you add a \strut.

(This is an issue with the chemical macros.)

Try label.rt (texttext("\strut right"), origin) ;

By the way, you can use:
	draw textext.rt ("\strut right") ;
	draw textext.top("\strut top") ;
	draw textext.lft("\strut left") ;
	draw textext.bot("\strut bottom") ;
which gives a tighter fit than label().


More information about the ntg-context mailing list