LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Proportional Font
Show HTML Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Date: Sun, 31 Mar 2019 18:57:32 -0300
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
MIME-Version: 1.0
Message-ID: <[log in to unmask]>
In-Reply-To: <[log in to unmask]>
Content-Type: multipart/alternative; boundary="00000000000017389d05856b00c8"
From: Phelype Oleinik <[log in to unmask]>
Parts/Attachments: text/plain (502 bytes) , text/html (995 bytes)
Hi Benjamin,

If you can't switch the catcode of & before looking for the
optional argument, as David suggests, you can use the !
argument modifier to disallow a space token before the
first “[”:

\NewDocumentEnvironment { sdapsarray } { !o }

in which case:

  & b

will work as expected, but:

\begin{sdapsarray} [] % note the space before the []
  & b


  & b

won't see the optional argument anymore.