[Therion] Metapost variable macro suffixes

Tarquin Wilton-Jones tarquin.wilton-jones at ntlworld.com
Sun Mar 1 21:04:50 CET 2020


I do seem to like answering my own questions.

3 days searching for the solution and ...

if A = (-1,1): sfx:="ulft";
elseif A = (0,1): sfx:="top";
...
if Foo = "b"
  thelabel.scantokens(sfx)(txt, pos);
  ... other stuff ...
else:
  p_label.scantokens(sfx)(thetext,P,R,style);
fi;

Yes, scantokens can be used inline, as a function-like call that returns
an actual suffix token which becomes part of the macro's suffix when the
macro is subsequently called.

This is such a weird programming language :)



More information about the Therion mailing list