Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by h1439878.stratoserver.net (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id u34HHTx5003447 for ; Mon, 4 Apr 2016 19:17:30 +0200 Received: from relay2.uni-heidelberg.de ([129.206.119.212]) by mx-ha.gmx.net (mxgmx109) with ESMTPS (Nemesis) id 0MT6Xi-1bE7SU13Yc-00SAi3 for ; Mon, 04 Apr 2016 19:17:24 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id u34HFxFN005523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Apr 2016 19:15:59 +0200 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id u34Asvd9004667; Mon, 4 Apr 2016 19:15:58 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 13536143 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 4 Apr 2016 19:15:58 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.119.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id u34HFwVa004170 for ; Mon, 4 Apr 2016 19:15:58 +0200 Received: from smtp4-g21.free.fr (smtp4-g21.free.fr [212.27.42.4]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id u34HFn1X005425 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 4 Apr 2016 19:15:52 +0200 Received: from [IPv6:2a01:e35:2e92:63f0:fa16:54ff:fef7:e1a8] (unknown [IPv6:2a01:e35:2e92:63f0:fa16:54ff:fef7:e1a8]) (Authenticated sender: frnchfrgg) by smtp4-g21.free.fr (Postfix) with ESMTPSA id 5D1EF4C812B for ; Mon, 4 Apr 2016 19:11:30 +0200 (CEST) References: <57029370.4090909@free.fr> <57029C43.8090605@latex-project.org> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Message-ID: <5702A144.3030205@free.fr> Date: Mon, 4 Apr 2016 19:15:48 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: "Julien RIVAUD (_FrnchFrgg_)" Subject: Re: Bug in \NewDocumentEnvironment To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <57029C43.8090605@latex-project.org> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-MIME-Autoconverted: from 8bit to quoted-printable by relay2.uni-heidelberg.de id u34HFxFN005523 Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:YNiONJZmt2U=:ON7H0VWiPYP1sBJAYygtZQxb+2 0YpPpnlUQ3kncodBHQhq98oJfQFvULyIGNfjMYnVQL2zp/f0KcprYFe7EqIrkEG7JS8BNkceJ K59DFLMMgHVSi72em9gczCnmbcvEyQoYpBRZXcIwr9Qv1v6fAAnf1IXL/I+vlcoIcv15GQ7yy w5u69+MVkohjOtJXHFx1Ivf/clo1w7GXVOYiDEem6/Pf6uATQKTIl0o5unETL9BYj/QivOeYz mAnlN2HlIrWVSH7zIF3y4KQgDmO40+Imk9z7di1ASCrJOrzjleFDV3vd+Ss56W9i9jiMzSrAE AXuQRzN/cBIMX0UysqNFLbxm1WPol398XNdMP6XUG7ZkZ4SRZrGoa4CDqXUdYyDouDG3eBbbd ymiXD/QsKOGfzlHyOiSBkoot6gg0q5sGkgyBC7r1d/AwcEeaQzWn5Pl+CqApijPrT4J8+f0m2 qeF0bHI+ey6Fu6jRF/7bFrpr+LWtLP4QemAJ/SxexIQ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FWlCOJyLsAXTcbpIoJsNHlRpZu9Kz/EjM+NEGHplZQF5nWguP2RtZO8lbL Z1WZTU0I7wb2fd9ArcaGLKfd+taPbPT5BHu0a+RB95ZCxsc4he87NQ== X-UI-Loop:V01:9m3z9r6Gwxs=:MFfcfDWK59XS0P/FUdjvwNuRV66oC9lUx39LnB5v+gE= X-UI-Out-Filterresults: notjunk:1;V01:K0:1vew0NV7Xyc=:A5t0R+3QW++uHY9hYIBX1L QDIsZnLovDptKZ6dnk8j/ipp2Fs6wRwwGcm/d0B82cfoUadeiJslRe+fY7yYLg7Q7AKkoxxWk kRAYFAcnXoPMFRWuZ76c5e+V6LREOAn165D1lZBTp3Dm+pFdANTZnNKAHy7n0XpsBe2jntn37 LdXqId0h7+Wor3Psoe/R+ibMglCdzVYa4RC6HJPA6Ikrf6qkQ7B8IlAGsNECyLxSWK8ssgTFp OX3O+xfn5Lx5cxzGxc2nG0TbJcAGn/BtNmcDRgQbhOeXyK9xjkCBJF8X+1mmjmLuWEH5wxU7e LCutO/haZCPwsQWdzwMZc9YK9belvVBSG29Kfi1Nlu8acC+uardxmWqNr9a1GVzkzVsURFHCS OLoffUtCGG+jQS3MrpL3PuBDOBldEAlAKOMf3bRlGLSdVfbqTznj6MBzCuffhQ7+sGY9nuTU7 HxQl0JTK5woHLDk/Tb0ADt9+nT8gXgDXufggh1fOGkzm3Kwf+FYbIvZUo8QgpoenfNuINQiDL fcDoSVemTOq4ovxUjNt6/2be3w1MshXUtKpqm9xuNNr X-Scanned-By: MIMEDefang 2.71 on 85.214.41.38 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by h1439878.stratoserver.net id u34HHTx5003447 Status: R X-Status: X-Keywords: X-UID: 7924 Le 04/04/2016 18:54, Frank Mittelbach a écrit : > guess this is a case of \protected being harmful > > Am 04.04.2016 um 18:16 schrieb Julien RIVAUD (_FrnchFrgg_): > >> \NewDocumentEnvironment{foo}{m}{% >> \begin{tabular}{#1}% >> }{% >> \end{tabular}% >> } >> >> \begin{document} >> >> \fbox{ >> \begin{foo}{ccc} >> \hline >> Test & a & b \\ >> \hline >> \end{foo} >> } >> >> \fbox{ >> \begin{tabular}{ccc} >> \hline >> Test & a & b \\ >> \hline >> \end{tabular} >> } >> >> \end{document} >> >> The first and second \fbox-es should produce the same output, but don't: >> the foo environment starts a second line at closing time, before the >> control is passed to the author-supplied closing code. > > actually that's not equiv, equiv would be something like defining "baz" > > \newenvironment{baz}[1]{% > \begin{tabular}{#1}% > }{% > \end{tabular}% > } Sure, but even if \newenvironment had the bug, I would have considered it a problem in xparse. > > but yes, same difference > > reason is the following difference in processing: > > \show\endfoo > \show\endbaz > > > \endfoo=\protected macro: > ->\environment foo end aux . > l.10 \show\endfoo > > ? > > \endbaz=\long macro: > ->\end {tabular}. > l.17 \show\endbaz > > the \protected hides the \crcr inside \endtabular. And in fact it hides any \crcr we could put in our closing code... I thought that it had to do with protection (this mail is a spin-off from a P.S. in the other thread), because I had to unprotect some of my commands in my table stuff. BTW, I wrote a package that parse CSS-like syntax to define properties of table cells, like real padding or min-width/height/depth (it also fixes the vertical alignment problem by taking the *real* height of the first row or the *real* depth of the last row into account, not just the strut box). It uses mdwtab as a base. For now it computes each cell #row-#col values, but doesn't support :nth-child() selectors (or any other selector than "td") so it is unfinished. Quite useful as a replacement for extrarowheight and/or vgap to get better table output (and I just found that it also affects amsmath's |cases|, so the parent selector needs to be handled soon). I really need to learn to write proper .dtx files, and submit my stuff on CTAN. Cheers, Julien