LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Classic View

Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

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

Print Reply
Phelype Oleinik <[log in to unmask]>
Sun, 31 Mar 2019 18:57:32 -0300
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