On 4/9/2026 10:39 PM, Wolfgang Schuster wrote:
Hi,

what's the recommended way to make global changes to metapost commands which use the new luametafun interface?

Below is a simple example with lmt_text with the method I use for my own command.

\starttext

\startMPcode
draw lmt_text [ text = "Dummy" ];
\stopMPcode

\startMPcalculation
setparameters "text" [ color = "red" ];
\stopMPcalculation

\startMPcode
draw lmt_text [ text = "Dummy" ];
\stopMPcode

\stoptext

definitions (once)

inclusions  (so that you can chnage in the meantime)

\starttext

\startMPcode
draw lmt_text [ text = "Dummy" ];
\stopMPcode

% \startMPdefinitions
% setparameters "text" [ color = "red" ];
% \stopMPdefinitions

\startMPinclusions
setparameters "text" [ color = "red" ];
\stopMPinclusions

\startMPcode
draw lmt_text [ text = "Dummy" ];
\stopMPcode

\startMPinclusions
setparameters "text" [ color = "green" ];
\stopMPinclusions

\startMPcode
draw lmt_text [ text = "Dummy" ];
\stopMPcode

\startMPinclusions
setparameters "text" [ color = "blue" ];
\stopMPinclusions

\startMPcode
draw lmt_text [ text = "Dummy" ];
\stopMPcode

\stoptext

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to