LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

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

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

Print Reply
Subject:
From:
Bruno Le Floch <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Thu, 21 Apr 2016 14:08:40 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (47 lines)
On 4/21/16, Lars Hellström <[log in to unmask]> wrote:
> Joseph Wright skrev 2016-04-20 22.18:
>> Hello all,
>>
>> Submitted today a minor update to the usual bundle to address a couple
>> of issues during TL'16 pre-testing:
> [snip]
>> - Allow expansion of end-of-environment code such that e.g.
>>
>>      \NewDocumentEnvironment{foo}{}{\begin{tabular}{\end{tabular}
>>
>>    works as expected
>
> Unintentionally funny when you read it literally. "What could they have done
>
> to make /that/ work differently??" :-)
>
> Lars Hellström

True.  For those who don't know what we are talking about: to support
both the syntax with a trailing \\ and without, the LaTeX2e
\end{tabular} uses the TeX primitive \crcr.  So

    \begin{tabular}{cc}
       Test & test \\
    \end{tabular}

    \begin{tabular}{cc}
       Test & test
    \end{tabular}

both produce a single row.  Environments defined by xparse used to be
"\protected", which stops TeX from seeing \crcr right after \\, hence
made it believe that the row was not ended by \\ and made it add an
extra row.  Thus xparse's

    \NewDocumentEnvironment{foo}{}{\begin{tabular}{cc}}{\end{tabular}}
    \begin{foo}
      Test & test \\
    \end{foo}

used to produce two rows and now produces a single one, as expected.

Regards,

Bruno

ATOM RSS1 RSS2