LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

 Options: Use Classic View Use Monospaced Font Show HTML Part by Default Condense Mail Headers Topic: [<< First] [< Prev] [Next >] [Last >>]

 Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-z/ujdVECtNJPMZKd/6mj" Date: Mon, 1 Apr 2019 09:29:53 +0200 Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]> From: Benjamin Berg <[log in to unmask]> Message-ID: <[log in to unmask]> In-Reply-To: <[log in to unmask]> MIME-Version: 1.0 Sender: Mailing list for the LaTeX3 project <[log in to unmask]> Parts/Attachments: text/plain (944 bytes) , signature.asc (832 bytes) Hi, On Sun, 2019-03-31 at 18:57 -0300, Phelype Oleinik wrote: > If you can't switch the catcode of & before looking for the > optional argument, as David suggests David has a good point, I could handle the optional argument parsing myself and ensure that the case works correctly. It may not be trivial, but it should be reasonably easy. It had not occurred to me that I could do that. > you can use the ! argument modifier to disallow a space token before > the first “[”: > \NewDocumentEnvironment { sdapsarray } { !o } Oh, I really like the simplicity of that solution. Thanks to you and David for the suggestions! Benjamin > 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