On 1/25/2026 3:43 PM, Fabrice Couvreur wrote:
Hi,
Thanks for your suggestions, they work !
However, I'm not sure I fully understand : why do the letters p, P, m or
M generate this error when they work in the example below ?
\starttext
\hskip 1em n=0
\stoptext
Because only "plus", "minus" and sometimes "limit" are valid keywords
for glue. So anything other than p P m M l L will be seen and end of the
specification.
Original tex does this:
pick up dimen
loop
check if we have "plus" and if so pickup dimen else push back
whatever read so far (expansion during scanning)
check if we have "minus" and if so pickup dimen else push back
whatever read so far (expansion during scanning)
if none of these quit loop
end
So, when we have many keywords, there's a lot of pickup and push back
happening (which involves expansion, building token lists, pushing back
collected stuff, pushing input level etc)
In luametatex we have a bit more efficient approach but as a result we
don't pickup what doesn't need to be picked up.
Anyway, in all these lookahead situations, it's best to be explicit when
you want scanning to end, so
\hskip .... \relax
\hrule .... \relax
or as Wolfgang explains, use {} as delimiters. Of course scanning also
stops when no letter is seen.
Scanning is case insensitive so PlUs is valid. Not making sure that
scanning is terminated when lookahead can happen is basically an error.
Think of a macro package doing:
\def\foo{\hskip3em}
and then the user:
test \foo plus a bit more
you don't want such errors so
\def\foo{\hskip3em\relax}
is a way out.
(Scanning is discussed in some docs in the distribution.)
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
___________________________________________________________________________________