[NTG-context] MPost: how to pass variables from mpost to TeX.

Hans Hagen Outside ntg-context@ntg.nl
Sun Jun 13 22:21:49 CEST 2004

vinuth madinur wrote:

>Hi everyone,
>              My mpost doesn’t have “textext” macro.
>So, what are the other ways of doing it? 
>What I want to do is this :
>%I have a variable “GbLableName”
>%Now I want to use this variable like this:
>lable.bot( btex GbLableName etex , (0,0) );
>But this will just display “GbLableName” instead of “B_2”.
>So can someone please tell how this can be done? I know too little about TeX.
>Someone suggested about using  “Textext” macro. But my MPost version doesn’t have it. 
>So are there any other ways of doing it?
btex ... etex is scanned by some mp tools and then tex'd; no expansion takes place then, so GBLableName becomes text

textext is more clever; 

why not use metafun then? it has everything metapost + more 



   your code 



(texexec --pdf thatfile.tex) 

will work ok; from within metafun/context you can use text variables (\MPstring and such); see metafun manual 


                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl

More information about the ntg-context mailing list