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 p4H0Yj78018133 for ; Tue, 17 May 2011 02:34:46 +0200 Received: (qmail 23094 invoked by alias); 17 May 2011 00:34:40 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 17 May 2011 00:34:40 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx043) with SMTP; 17 May 2011 02:34:40 +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 p4H0VlFs005738 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 May 2011 02:31:47 +0200 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 p4GM1I8K020833; Tue, 17 May 2011 02:31:46 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1207574 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 17 May 2011 02:31:46 +0200 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 p4H0VkYh031966 for ; Tue, 17 May 2011 02:31:46 +0200 Received: from mail-gy0-f177.google.com (mail-gy0-f177.google.com [209.85.160.177]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id p4H0VbDj007015 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Tue, 17 May 2011 02:31:44 +0200 Received: by gyh20 with SMTP id 20so336gyh.22 for ; Mon, 16 May 2011 17:31:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.193.42 with SMTP id j30mr27828yhn.51.1305592297178; Mon, 16 May 2011 17:31:37 -0700 (PDT) Received: by 10.147.41.17 with HTTP; Mon, 16 May 2011 17:31:36 -0700 (PDT) References: <4DCA93CC.5020605@morningstar2.co.uk> <19920.15087.714131.100464@morse.mittelbach-online.de> <447088.31292.qm@web24704.mail.ird.yahoo.com> <4DD0BFB3.7070007@morningstar2.co.uk> <27DAD3FD-9C28-4707-9454-FBB65B66A56D@gmail.com> <4DD0D8F4.7030101@morningstar2.co.uk> <4DD11D50.6000901@residenset.net> <19921.40225.730390.362395@morse.mittelbach-online.de> Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Whitelist: Message-ID: Date: Mon, 16 May 2011 20:31:36 -0400 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: xparse and space skipping To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (eXpurgate); Detail=5D7Q89H36p4yCuwxJv6KY7fMyn81QvEOYqtcHnYAtA5Ac9FCBCQhefPTuEoCkAlPpCG4u zWrU0X0EUauCPfqiEOJTPrrKk96wkTAhwOCgS6vF6AxpD5hiiA/qNQB9JmSpgv9FoUBsVv1AY11b ADGVzHFoZMjzuNph/TFJfAO5uk/9rthzX1Pmb5qfEDjrpdTn6os2HwdGfKknUpU+acbQQ==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: 6766 On 5/16/11, Bruno Le Floch wrote: > By the way, I wasn't really serious about dropping trailing optional > arguments. > >> > \bar{apa} cepa >> > >> > used to have a space, and \bar for some reason in a package needs to >> be >> > extended >> >> On the other hand I don't think that a package author doing this would >> get >> very happy customers > > It seems technically possible for xparse to store the info of whether > it has skipped spaces or not, and put them back in case there was no > optional argument. > > I quite like Frank's key-val + positional idea. However, I'd change it > a little bit by getting rid of the trailing optional arguments part by > delimiting the argument with (for instance) a semicolon. Uses of \\ > could then be > > \\ ; > \\ [3cm] ; > \\ * [3cm] < color=normal, decoration=fancy-flowers > ; > > This combines nicely with an earlier discussion on document > shorthands, noting that every document short-hand should really have a > trailing \Marker; to prevent \TeX; from losing spaces. These > short-hands could then easily be made to accept arguments by putting > them before the marker. Actually, maybe an approach with two types of commands. Firstly, document shorthands, among which \\, \TeX, \item, which may be followed by some optional positional arguments and key-value comma list, ended with ; . Secondly, document commands close to LaTeX2e, which take at least one braced argument, and as much as possible keep optional arguments before the last mandatory one. I guess the only thing in my post above is to say that we can make sure that there are never optional trailing arguments by enforcing the presence of an end-marker. Separate over-the-top idea (but workable): make # active (let to a normal #) so that it works in definitions etc, but within the document (i.e. whenever we are not doing a \DeclareDocumentCommand), define # to stop the look ahead for optional arguments. Then # could also be used to avoid losing spaces: \TeX# would leave the space alone,\newline# and \eTeX# and \LaTeX# users would strive! Ok... That's kind of ugly :(, I'll sleep. Regards, Bruno