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
Condense Mail Headers

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

Print Reply
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Fri, 31 Oct 2014 07:21:28 +0000
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Message-ID:
Subject:
MIME-Version:
1.0
Content-Transfer-Encoding:
7bit
In-Reply-To:
Content-Type:
text/plain; charset=utf-8
From:
Joseph Wright <[log in to unmask]>
Parts/Attachments:
text/plain (36 lines)
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

ATOM RSS1 RSS2