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
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 14:03:15 +0000
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="MCBoundary=_11903311503180321"
From: David Carlisle <[log in to unmask]>
Parts/Attachments: text/plain (1976 bytes) , text/html (2860 bytes)
On 31/03/2019 10:22, Benjamin Berg wrote:
> Hi,
> 
> I created an environment where I override the & character to be active
> and use it as a macro (rather than an alignment character). I am now
> running into the issue, that theoretically the user might not pass an
> optional argument and also use the & token as the first character
> inside the environment. In that case the token is interpreted as an
> alignment character.
> 
> The environment in question is currently defined with:
>     \NewDocumentEnvironment { sdapsarray } { o }
> 
> Now, this is a very rare corner case for me, and I am happy to simply
> document the limitation. But, I do wonder whether this may be
> considered a bug in the optional argument parser.
> 
> Benjamin
> 
> PS:
> This is in my custom SDAPS array environment (which is weird in a
> number of regards)
> https://sdaps.org/class-doc/sdapsarray.html#\sdaps_array_newline%3a
> shows the example with a workaround (last one on the page)
> 
> Failing code is:
>   \begin{sdapsarray}
>      & col 1 & col 2 \\
>     row header 1 & cell1 & cell 2
>   \end{sdapsarray}
> 
> while either:
>   \begin{sdapsarray}[]
>      & col 1 & col 2 \\
>     row header 1 & cell1 & cell 2
>   \end{sdapsarray}
> 
> or
>   \begin{sdapsarray}
>     {} & col 1 & col 2 \\
>     row header 1 & cell1 & cell 2
>   \end{sdapsarray}
> 
> works fine.
> 

you should (or at least could) define sdapsarray to just switch the 
catcode of & and then call an inner macro that does the optional 
argument parsing.

David

Disclaimer

The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. 

ATOM RSS1 RSS2