LATEX-L Archives

Mailing list for the LaTeX3 project


Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
Date: Thu, 6 Jan 2011 17:32:14 +0000
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
Message-ID: <[log in to unmask]>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
In-Reply-To: <[log in to unmask]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
From: Joseph Wright <[log in to unmask]>
Parts/Attachments: text/plain (33 lines)
On 06/01/2011 17:15, Frank Mittelbach wrote:
> xparse offer a fairly general snytax including variable delimiters and default
> values per argument and more. Perhaps you should *indeed* have a look at it
> one day :-) and it could be easily used on top of 2e if so desired

Also, while it's not implemented at the moment at a documented level, in 
principal you could globally alter the '[ ... ]' convention to some 
other delimiters for optional arguments by changing how the 'o' argument 
spec. is handled

> what is not offered right now is mandatory arguments with arbitrary delimiters
> on the left or right, though one could achieve even those in an emergency
> using "u" argument type twice (I guess)

It's unlikely to come up a lot, but I'd use an argument processor:

\NewDocumentCommand \test { > { \StripPrefix } u { stop } } {
\NewDocumentCommand \StripPrefix { m } { \StripPrefixAux #1 \q_stop }
\cs_new:Npn \StripPrefixAux start #1 \q_stop {
   \tl_set:Nn \ProcessedArgument {#1}
\test start some test text stop outside!
Joseph Wright