Joey McCollum via ntg-context schrieb am 09.12.2021 um 15:08:
I believe \orelse might be what you want. It works with most \if...
macros, and it avoids nesting of \doifelse constructs. Here's an
example, which I use in conditionally removing preceding punctuation
if any other keys are defined before a specific one in an assignment:
```
% If any of the preceding keys was specified, then replace any
preceding punctuation with a space
% and typeset the number with its CSL abbreviation, followed by a
comma
\ifdefined\btxsbllocvol
\removeunwantedspaces\removepunctuation\btxspace
\orelse\ifdefined\btxsbllocno
\removeunwantedspaces\removepunctuation\btxspace
\fi
\orelse\ifdefined\btxsbllocpt
[...]
\fi
```
The \fi at the end of each \orelse branch is wrong.
\ifdefined\btxsbllocvol
...
\orelse\ifdefined\btxsbllocno
...
\else
...
\fi
Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________