[metapost] pdftex \pdflastxpos for metapost?

Hartmut Henkel hartmut_henkel at gmx.de
Wed May 11 01:38:04 CEST 2005

Hi Dan,

On Tue, 10 May 2005, Daniel H. Luecking wrote:

> If etex is available, Hans' suggestion should work. Otherwise you can
> perhaps postprocess the written file (even in the same tex run):

> At the end of the document, define \foo to perform the dimension
> assignment and write the result to another file:

that's also a nice trick, thanks a lot!

> You could also write them as strings. MP can easily insert a decimal
> point character say 7 places from the right of the string. Then
> scantokens can be used to read the string as a number:
>  string X;
>  X := "123456";
>  X := "0000000" & X; % ensure at least 7 places
>  numeric n, w;
>  n:=length X;
>  X := (substr (0,n-7) of X) & "." & (substr (n-7,n) of X);
>  scantokens ("w:=" & X & ";");

I was fearing to tackle this (thought as with TeX macro parameters one
can pick stuff only from left to right, but with substr() one can go
from the right end). I like it. And we are back on list topic :-)

> Or use sarith.mp (afraid I know very little about it).

Same here, had tried it only shortly (no success).

Thanks a lot for help!

Regards, Hartmut

More information about the metapost mailing list