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 s9V7NOYC011127 for ; Fri, 31 Oct 2014 08:23:25 +0100 Received: from relay.uni-heidelberg.de ([129.206.100.212]) by mx-ha.gmx.net (mxgmx108) with ESMTPS (Nemesis) id 0MFzT8-1Xp0d81utC-00EywM for ; Fri, 31 Oct 2014 08:23:17 +0100 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id s9V7Ld8J003145 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 31 Oct 2014 08:21:39 +0100 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 s9V2DoAx032614; Fri, 31 Oct 2014 08:21:39 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 11490316 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 31 Oct 2014 08:21:39 +0100 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s9V7Ldmj013975 for ; Fri, 31 Oct 2014 08:21:39 +0100 Received: from smtp3.easily.co.uk (smtp3.easily.co.uk [91.194.151.18]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id s9V7LUBc026922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 31 Oct 2014 08:21:33 +0100 Received: from [109.158.98.3] (port=64707 helo=palladium.home) by smtp3.easily.co.uk with esmtpa (Exim 4.43) id 1Xk6WX-0006dR-Ht for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Fri, 31 Oct 2014 07:21:29 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 References: <545321A7.2080201@clear.net.nz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Message-ID: <54533878.5030100@morningstar2.co.uk> Date: Fri, 31 Oct 2014 07:21:28 +0000 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: group level and document commands To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <545321A7.2080201@clear.net.nz> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: 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:GLS2YNF7w6w=:9VSif6BF7aPeVsdcWKBWs9Ot6A UJVSd8kmECxC0Y8SO+Mp0CQRKiDyoghP6eZSg25BI5LyGoO8hppvbWG1JSFoCVPYaWO4qO9oJ iQ1IPkwNfIVK0bLlO/kn2Tz7+yjLhQlT2RgCq1lZTCy8PlKrzCNcI08rN3GIyfmTpmpjMx2/A n/Syl4PvsoHEx0rNr3D+NapE+v5ao1sIRsXSs9YpuzsQU6jeu6tWQ7HKOscqzclLgMqAUbTxL WNJCp32350cfSXX336kZaCtUivul+xC8mxE4SaWYYjh347PKPXBVg96nfD378jqMCX+L08Ee4 FUO9DV09bcJyP1f2eUf+GtB2HsMjA7AHxn/DWNu/nV+7W+1pKGHaD9ZyDon7/UJkkISA5ULqv SkX1rps/pvAvwsvGfL42xwX2XNq6aPMWWsGiz3mGXx715PPy5XDLN2QbQhOqpTScfKk7LgN3U 3d1KC1Pv5bHHI46UrFEPRHVJKlOZVW/mjqN95JCI/r86sXPs+vojroWm4fELIzHdEX3cVBqKH mzPcOQUoxMyEMuJWQmt3hLD1daeaZ+0XZ1dPHa6iOpGLwDdFSL9w1G8Ynum+3Ys7gIpG+v9oe R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terresults: notjunk:1; X-Scanned-By: MIMEDefang 2.71 on 85.214.41.38 Status: R X-Status: X-Keywords: X-UID: 7621 On 31/10/2014 05:44, aparsloe wrote: > A section of code that worked for me in July only partly works now. One > issue that I've noticed is that > > \group_begin: > ... > \DeclareDocumentCommand \test ... > ... > \group_end: > > will not in fact create a document command \test -- I get an "Undefined > control sequence" message when I try to use it in the wider document. > The declaration must be outside the group commands -- at least that is > what my experiments tell me. (But \test is recognised within the group > commands.) Is that correct? And is it new? -- I don't recall meeting > this issue back in July. > > The xparse documentation doesn't seem to mention this issue and perhaps > should. I can understand the documenters assuming that a document-wide > command would only be defined at the highest level, but in my context > (working with instant preview in LyX) it was quite natural to define it > within the \group_begin:, \group_end: commands of another funtion. I've > changed that now which has resolved at least some of the problem. > > Andrew xparse has never created global commands: they are local to TeX groups. This has not changed recently, so I am not sure why you've not noticed it before. The question of dealing with context-dependent commands is still an open one, but at the moment having \DeclareDocumentCommand respect grouping seems to be the most sensible approach. -- Joseph Wright