Am 25.11.25 um 22:54 schrieb Max Chernoff via ntg-context:
\define[2]\Conv{\unit{\dimexpr\scratchdimen #1 \the\nodimen #2
\scratchdimen\relax}}

1. Setting a dimension isn't expandable, so you need to do that before
    using \unit.

2. You need to make sure that the argument to \unit is expanded before
    \unit itself is.

I’m not sure I’ll ever catch the intricacies of expansion… :/

The following should work as expected:

     \mainlanguage[de]
     \setupunit[method=3,space=small,]
     \define[2]\Conv{%
         \scratchdimen=#1
         \normalexpanded{\noexpand\unit{\the\nodimen #2 \scratchdimen}}
     }

This works as intended, thank you very Max!
Hraban
___________________________________________________________________________________
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