[metapost] macros with text argument

Emanuele Sacco emanuelesacco at gmail.com
Thu Dec 23 11:23:54 CET 2010


thanks to all.

ES

2010/12/23 Yasir Malik <ymalik at stevens.edu>:
>> How can I define a macro that take a text as argument and put it in a
>> label? Something like this
>>
>> %---------
>>
>> def assi(text labeltext) =
>> label(btex labeltext etex, (0,0));
>> enddef
>>
>> %---------
>>
> You can try the following:
> input TEX;
>
> def assi(text labeltext) =
> label(TEX(labeltext))
> enddef
>
> With the TEX macro, you can pass strings, numbers, and construct equations
> using $$.  Check out page 65 of the MetaPost manual for more info.
>
> Regards,
> Yasir
>



-- 
Al mondo ci sono 10 tipi di persone: quelli che conoscono il sistema
binario e quelli che non lo conoscono.



More information about the metapost mailing list