[NTG-context] MPinclusions strangeness with labels

Aditya Mahajan adityam at umich.edu
Tue Jun 6 15:44:05 CEST 2006


On Tue, 6 Jun 2006, Jean Magnan de Bornier wrote:

> Hi all,
>
> I found something strange with a metapost file where I want to store
> various definitions for reuse in several tex files; here are example
> files:
>
> .......inc.mp...............
> numeric u; u=.8cm;
> path AX; AX = (10u,0) -- (0,0) -- (0,10u);
>
> picture cax; cax = thelabel(textext("Costs, prices") rotated 90,(-.3u,8u));
> ............................
>
> .......inc.tex..............
> \setupoutput[pdftex]
>
> \startMPinclusions
> \input inc
> \stopMPinclusions
>
> \starttext
>
> \startuseMPgraphic{toto}
> drawdblarrow AX;
> % label.rt(textext("$3x^2+\pi$"), (5u,6u));
> draw cax;
> \stopuseMPgraphic
>
> \placefigure[left]{bla.bla}{\useMPgraphic{toto}}
>
> \input dawkins
>
> \stoptext
> ............................
>
> Now what happens? The label in the mp file "Costs, prices" is replaced by
> "unknown" in the pdf. But if I add a label in the startuseMPgraphic
> environment, (decommenting line 3 in it), then both labels appear!!
>

This is because of the way textext works. tex.rb scans the file to see 
if textext is present. It is not, so it does not use mpx. When you 
uncomment the line, textext is present and mpx files are processed.

> I tried several other files, it seems to happen every time.
> Anything I'm doing wrong?

Add \forceMPTEXgraphictrue on top of your file if you want to force 
mpx to be run everytime. I do not know the equivalent command line 
switch (if there is any)

Aditya



More information about the ntg-context mailing list