Am 24.01.2026 um 20:23 schrieb Rogers, Michael K:
Hi,

It appears that \hskip is parsing the “P” as part of the skip amount. You get similar trouble with “M”, “p”, and “m”.

Engines like pdfTeX or LuaTeX are stricter and expect the complete optional argument (e.g. plus or minus) but LuaMetaTeX only takes a look at the first letter the determine (e.g. p or m) if it's an optional argument.

Putting \relax at the end of the skip amount works for me. Perhaps there is a better solution?

        …
        \hskip 1ex  def proba(k):

        \hskip 1ex\relax  P = 0

        \hskip 1ex for i in range(0,k+1):
        …

A recent addition to the dimension (and number) scanner in LuaMetaTeX are braced arguments which removes the need for \relax, in addition you can use \numexpr expression (e.g. \hskip{1em+2em}).

\starttext

a\hskip 1em b

a\hskip 1em plus 1em b

a\hskip {1em} plus 1em b

\stoptext

Wolfgang

___________________________________________________________________________________
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