Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id p06HYgSW005713 for ; Thu, 6 Jan 2011 18:34:43 +0100 Received: (qmail 5573 invoked by alias); 6 Jan 2011 17:34:37 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 06 Jan 2011 17:34:36 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx077) with SMTP; 06 Jan 2011 18:34:36 +0100 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 p06HWbRI026775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 Jan 2011 18:32:37 +0100 Received: from listserv.uni-heidelberg.de (localhost.localdomain [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p06FGB3I001194; Thu, 6 Jan 2011 18:32:35 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 806507 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Thu, 6 Jan 2011 18:32:35 +0100 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p06HWZux019137 for ; Thu, 6 Jan 2011 18:32:35 +0100 Received: from ueamailgate01.uea.ac.uk (ueamailgate01.uea.ac.uk [139.222.131.184]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id p06HWKt8012472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 6 Jan 2011 18:32:24 +0100 Received: from ueams01.uea.ac.uk (ueams01.uea.ac.uk [139.222.131.78]) by ueamailgate01.uea.ac.uk (8.13.8/8.13.8) with ESMTP id p06HWCGG029738; Thu, 6 Jan 2011 17:32:12 GMT Received: from [139.222.113.126] by ueams01.uea.ac.uk with esmtp (Exim 4.69) (envelope-from ) id 1Path5-0004dY-Se; Thu, 06 Jan 2011 17:32:11 +0000 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 References: <1713005794.1189899.1293724895711.JavaMail.fmail@mwmweb012> <19749.63653.743551.563511@morse.mittelbach-online.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN, outgoing) X-CanIt-Geo: ip=139.222.131.78; country=GB; region=I9; city=Norwich; latitude=52.6333; longitude=1.3000; http://maps.google.com/maps?q=52.6333,1.3000&z=6 X-CanItPRO-Stream: UEA:outgoing (inherits from UEA:default,base:default) X-Canit-Stats-ID: 66602462 - 1cbeba984367 - 20110106 X-Scanned-By: CanIt (www . roaringpenguin . com) on 139.222.131.184 Message-ID: <4D25FC9E.7040705@morningstar2.co.uk> Date: Thu, 6 Jan 2011 17:32:14 +0000 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: variable opt arg delimiters [was: Defining a ...] To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <19749.63653.743551.563511@morse.mittelbach-online.de> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p4U4jfdfC5HDevlx1X2sAZgAaLl3DbFfW0PXxL7WgvovMFXXSEPrACW/b9IW Qp+GhEViZlUW4mdBntgP1X8KwB5tjHCA/yxSZMu7BXBiPs3ujyaoi2xLHDqpg8dk65Dhpb3Lg0c1 iTjGg==V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de Status: R X-Status: X-Keywords: X-UID: 6539 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: \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand \test { > { \StripPrefix } u { stop } } { Argument~received:~`#1' } \NewDocumentCommand \StripPrefix { m } { \StripPrefixAux #1 \q_stop } \cs_new:Npn \StripPrefixAux start #1 \q_stop { \tl_set:Nn \ProcessedArgument {#1} } \ExplSyntaxOff \begin{document} \test start some test text stop outside! \end{document} -- Joseph Wright