On 3/13/2021 12:10 AM, Peter Münster wrote:
On Wed, Jan 27 2021, Wolfgang Schuster wrote:
When not all optional arguments are used the space after the last
given argument is gobbled. This was normal behavior for a long time
until you changed the code in MkIV to keep them.
Hi,
What does that mean? Is that going to be changed?
How should \date[] be used now in the text?
For now, I do it like "bla \date[d=3]\ bla".
Is there a nicer way?
TIA for any hints,
The problem with an interface with optional arguments is that it has to
look ahead. There are actually some macros that use this feature to get
rid of upcoming spaces (picking up two optional arguments where one is
needed). So, no matter what solution is chosen: push back a space or
not, it has some unpredictable character.
This is why I always am explicit, as in \date[d=3]\ bla because no
matter what happens bvehind the screens, the \ terminates the argument
check so it will stay. (I admit that i'm mnore often bitten by the
pushed back one than the gobbled one so i make it a habit to be explicit
about spaces, like like i use \removeunwantedspaces when i'm not sure
when there can be spaces that crept in).
We can of course in lmtx bring back the 'push back a space' behaviour
but we then also introduce some fuzzyness. Now we have "we scan upto n
arguments and gobble spaces when doing so".
Btw, there is also another aspect: when looking for optional arguments
the next token gets looked at and that one can be in an upcoming macro
or content.
\startfoo[a][b]
content
\stopfoo
\startfoo[a]
[ that starts content
\stopfoo
so sometimes one needs
\startfoo[a]
\relax [ that starts content
\stopfoo
to abort the scanning.
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 : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___