## LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

#### View:

 Message: [ First | Previous | Next | Last ] By Topic: [ First | Previous | Next | Last ] By Author: [ First | Previous | Next | Last ] Font: Proportional Font

Subject:

Rescanning first token of environment when no optional argument is given

From:

Date:

Sun, 31 Mar 2019 11:22:56 +0200

Content-Type:

multipart/signed

Parts/Attachments:

 text/plain (45 lines) , signature.asc (45 lines)
 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.