LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

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:

\begin{sdapsarray}
  & b
\end{sdapsarray}

will work as expected, but:

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

and:

\begin{sdapsarray}
  []
  & b
\end{sdapsarray}

won't see the optional argument anymore.

Best,

Phelype


ATOM RSS1 RSS2