[metapost] macros with text argument

Troy Henderson thenders at gmail.com
Wed Dec 22 23:18:23 CET 2010


It might be easier to pass a picture to your macro.  After all,
placing "btex" ... "etex" around your text is going to create a
picture anyway, so if you're always going to place it inside a btex
... etex, you might as well just pass it as a picture.  Also, since
the first argument of the label command can be a picture or string,
the following should work.

def assi primary p =
label(p,origin);
enddef;

If you call assi where its argument p is a string, then it just labels
it (without TeX), but if p is a picture (likely created by "btex <some
text> etex"), then it will label it also.

Troy Henderson


More information about the metapost mailing list