I am curious if there is a technical reason that the token-type args of xparse must follow the correct order?


\NewDocumentCommand{\foo}{s t+}{---
\IfBooleanT{#1}{star }
\IfBooleanT{#2}{plus }---\par}
\foo \foo* \foo+ \foo*+ \foo+*
%                        swapping order doesn't work
  • 1
    it would be more work to allow any order (and not really any clearer, and would make the behaviour of {ss} rather harder to define. Nov 5, 2021 at 21:17
  • 1
    most people think of a command like \section* as a command with name section* (rather than a command with a boolean marker following) so it would be odd to allow \section + * to be a variant of \section* Nov 5, 2021 at 21:19
  • 1
    @DavidCarlisle my thought, for example, was that + wouldn't be a modifier for \section*, but just another modififer for section. For example, * disables number and ToC entry, but + could change the style of the section text, for exampke. How ** would be handled IMO is one * is True False and two ** is True True, Just wanted to throw this out there, hopefully it brings some consideration for xparse--an incredibly useful package btw, thanks. Nov 6, 2021 at 1:19

1 Answer 1


You're asking for an optional * which can be followed by an optional +. The combination +* has not been envisaged in the definition, so with


the command \IfBooleanT{#1} returns false (hence nothing).

Do you want to allow any combination? Then you have to work harder.



   {% at most two characters among * and +
   {% replace with

\cs_new_protected:Nn \veget_foo:n
  \str_case:nn { #1 }












enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .