LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Proportional Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
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]>
Subject:
From:
Benjamin Berg <[log in to unmask]>
Message-ID:
In-Reply-To:
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


ATOM RSS1 RSS2