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 p4FLGwJ1015627 for ; Sun, 15 May 2011 23:16:59 +0200 Received: (qmail 28455 invoked by alias); 15 May 2011 21:16:53 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 15 May 2011 21:16:52 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx009) with SMTP; 15 May 2011 23:16:52 +0200 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 p4FLEbuj031549 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 15 May 2011 23:14:37 +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 p4EM15k7020093; Sun, 15 May 2011 23:14:36 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1210073 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sun, 15 May 2011 23:14:36 +0200 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p4FL4axT031596 for ; Sun, 15 May 2011 23:04:36 +0200 Received: from nm19-vm0.bullet.mail.ird.yahoo.com (nm19-vm0.bullet.mail.ird.yahoo.com [77.238.189.92]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with SMTP id p4FL4LIK025466 for ; Sun, 15 May 2011 23:04:22 +0200 Received: from [77.238.189.53] by nm19.bullet.mail.ird.yahoo.com with NNFMP; 15 May 2011 21:04:21 -0000 Received: from [212.82.108.252] by tm6.bullet.mail.ird.yahoo.com with NNFMP; 15 May 2011 21:04:21 -0000 Received: from [127.0.0.1] by omp1017.mail.ird.yahoo.com with NNFMP; 15 May 2011 21:04:21 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 744645.52509.bm@omp1017.mail.ird.yahoo.com Received: (qmail 31697 invoked by uid 60001); 15 May 2011 21:04:21 -0000 X-YMail-OSG: mN.JP7UVM1kbVD2.OmPzIue7XV1nuJqlvOXGsVBq_6I3kmO CP7HoFfSiKzoUFq_ieHUgIqpDaV8uWlAFkOBJVc9qSMco.5LWrPhdaNTOUAZ a1ZObN4e0vrqrVUEnjhqHCUSzDG2R.RTHeAFL2TWp7Z0ujcGsXqOOX9Mm3ZK vZ4klHRq1ZGxwxyMc.XadExKSKna3jO80mbKJeIYkeBdASohV8mn3QHlbZb2 wEbHR0T0jH_OzMefxJqM3.YBBArbif3bGXiU56EiNM08f_6emshzmkKGNa1G JIhJJ6_jHKFXAX7NhjsksaVERtjiuoMCRVGVfj1eYgK3IPnG_R9VJvKqZWHV jbY3zv6D9 Received: from [82.45.249.212] by web24704.mail.ird.yahoo.com via HTTP; Sun, 15 May 2011 22:04:20 BST X-Mailer: YahooMailWebService/0.8.111.303096 References: <4DCA93CC.5020605@morningstar2.co.uk> <19920.15087.714131.100464@morse.mittelbach-online.de> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-99627480-1305493460=:31292" Message-ID: <447088.31292.qm@web24704.mail.ird.yahoo.com> Date: Sun, 15 May 2011 22:04:20 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Chris A Rowley Subject: Re: xparse and space skipping To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <19920.15087.714131.100464@morse.mittelbach-online.de> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (eXpurgate); Detail=5D7Q89H36p6HRL9CJLUCw+qCfRO7IcZXZDCb48vLJ+5P4a0Jh2+d+1TfenbyFsv7JEA3D /gCD7cWJYRBVCEAMeN17jVAu2l/t4Bo4AI7Ex35ZMixbE7LncFFhd1Mkq8h3HFD8br/BSBysWIto +vdYwIaNCKo38sM300cvOgQbOYeqDYmJ4Y6laMSGvb+RMx5Pm1nrhNOWt233mcxKkqH2w==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: 6748 --0-99627480-1305493460=:31292 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Another common use-case where (as with the AMS \\ in maths)=0Asomething non= -standard seems intuitive is things=A0=0A'\item-like \foo s'=A0=0A=0A=0AWhe= re=0A=0A\foo [arg] =A0 has the standard 'argument meaning'=0A=0Abut=0A=0A\f= oo=0A[Paranthetical text starts here. ...=0A=0A=0Adoes not.=0A=0A=0A----- O= riginal Message -----=0AFrom: Frank Mittelbach =0ATo: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE=0ACc: =0ASent: Sunday, 15= May 2011, 21:43=0ASubject: Re: xparse and space skipping=0A=0AJoseph Wrigh= t writes:=0A> You may remember that a while ago we discussed space skipping= for=0A> optional arguments with xparse, for example=0A> =0A>=A0 =A0 \foo{m= andatory}[optional] other text=0A>=A0 =A0 \foo{mandatory} [optional] other = text=0A>=A0 =A0 \foo{mandatory}=A0 other text=0A> =0A> At the time, the fee= ling was that we should not skip spaces in these=0A> cases, so only the fir= st of my examples is parsed as containing an=0A> optional argument.=0A=0AMu= st confess that I can't remember that discussion nor the feeling that=0Ares= ulted from it, but regardless of what I may have argued for in that=0Adiscu= ssion (if I was part of it) looking at the above scheme I don't think I=0Al= ike it or think it would be helpful.=0A=0AFor starters in my opinion xparse= is a module made to largely mimic the look=0Aand feel of current 2e docume= nt level approach and what you describe here is a=0Astrong deviation from t= hat. (this is independent of the fatc that there may be=0Aa completely diff= erent approach to document level syntax, eventually, but this=0Ais not what= xparse was meant to be).=0A=0AIn a syntax of that sort, there needs to be = good ways to naturally break up a=0Acommand and its arguments in different = lines and a natural way to do that is=0Ato break between arguments (rather = than inside) often even putting longer ones=0Aon single lines,eg=0A=0A=A0 = \foobarbaz {aaaaaaaaaaaaaaaaaaaaaaaaa}=0A=A0 =A0 =A0 =A0 =A0 =A0 =A0 [bbbbb= bbbbbbbbbbbbbbbbbbbb]=0A=A0 =A0 =A0 =A0 =A0 =A0 =A0 [ccc]=0A=0Aor even=0A= =0A=A0 \foobarbaz=0A=A0 =A0 {aaaaaaaaaaaaaaaaaaaaaaaaa}=0A=A0 =A0 [bbbbb= bbbbbbbbbbbbbbbbbbbb]=0A=A0 =A0 [ccc]=0A=0ATo be forced to keep the arg bo= undaries on a single line or add %s all over=0Athe place is just not the wa= y people currently use LaTeX (besides I think it=0Arather looks fairly ugly= and unreadable).=0A=0AAnd 2e is consistent here. They only well-known exce= ption is \\ in the amsmath=0Areimplementation. To my knowledge this is real= ly the only exception - if I'm=0Awrong please somebody tell me what else is= not following the general skipping=0Aof spaces scheme.=0A=0ANow one could = argue that that this=A0 behavior for \\ is useful (especially in=0Amath for= which amsmath reimplements it) but realistically what are the other=0Aplac= es that need this kind of behavior?=0A=0AThe problem is this type of behavi= or is really most wanted in fairly simple=0Acommands, say with just one opt= ional argument or just a single star plus=0Aperhaps optional argument. And = there you run into the snag that you either=0Ahave to implement a full blow= n scanner yourself and=A0 disable TeX's internal=0Ascanner completely (such= as turning anything into catcode 13 and assemble=0Aeverything yourself). O= f course that is possible, but ...=0A=0AIf you don't want to go that far th= en commands like \linebreak etc will always=0Asuffer from the fact that the= re will be spaces allowed between them and a=0Afollowing [.=0A=0AAnd in fac= t the general sentiment of this all needs to be configurable=0Aindividually= for any command is in my opinion a bad guide. It just mean that=0Anobody k= nows what will happen on many commands as there is no rule other than=0Aloo= king up how there are defined. And in my opinion this makes up an ugly user= =0Ainterface. =0A=0Ahere is my summary=0A=0Aallow spaces but not \par betwe= en arguments=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=0A= pros=0A- consistent=0A- like 2e=0A- easy to remember=0A- makes for readable= sources on the whole=0A=0Acons=0A- would not support the \\ case as implem= ented by amsmath=0A=0A=0Ado not allow spaces between arguments=0A=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=0Apros=0A- consistent=0A- easy to remember= =0A- would support the \\ case as implemented by amsmath=0A=0Acons=0A- comp= letely different to 2e behavior=0A- makes for fairly unreadable sources on = the whole=0A=0A=0Aleave it to the command how spaces between arguments are = interpreted=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=0A= pros=0A- would support the \\ case as implemented by amsmath=0A- makes for = fairly unreadable sources on the whole=0A=0Acons=0A- inconsistent interface= =0A- difficult to remember how individual commands behave=0A- more likely t= o intorduce errors where you find argumnts ending up in text=0Aby mistake= =0A=0A=0A> So looking again at this I think we should 'follow TeX', and be= =0A> consistent in skipping spaces in all cases. I don't like the fact that= =0A> at present there is a somewhat convoluted explanation of the behaviour= =0A> in the xparse documentation: this tends to show up when something is n= ot=0A> really correct! (At the same time, the implementation would be sligh= tly=0A> easier to follow if this change was made.)=0A> =0A> Does this seem = reasonable?=0A=0Ato me yes.=0A=0AThere would still be the question of contr= ol symbols viz control words. By=0Adefault a control symbol (e.g., \? \/ ..= .) will not skip spaces and \\=0Aactually explicitly has code to scan and i= gnore spaces so was deliberately put=0Ainto the command class by Leslie to = get a consistent interface for his main=0Acommands (and amsmath changed it = back).=0A=0ABut I find a single exception (if implemented) still preferable= to the other=0Aoptions.=0A=0Afrank=0A --0-99627480-1305493460=:31292 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Another common use= -case where (as with the AMS \\ in maths)
something = non-standard seems intuitive is things 
'\item-like \= foo s' 

Where

\f= oo [arg]   has the standard 'argument meaning'

but

\foo
[Paranthetical text starts he= re. ...

does not.


----- Original Message -----
From: Frank Mittelbach <frank.mitt= elbach@LATEX-PROJECT.ORG>
To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE
C= c:
Sent: Sunday, 15 May 2011, 21:43
Subject: Re: xparse and space sk= ipping

Joseph Wright writes:
> You may remember that a while = ago we discussed space skipping for
> optional arguments with xparse, for example
>
>    \foo{mandatory}[option= al] other text
>    \foo{mandatory} [optional] other text<= br> >    \foo{mandatory}  other text
>
> A= t the time, the feeling was that we should not skip spaces in these
>= ; cases, so only the first of my examples is parsed as containing an
&g= t; optional argument.

Must confess that I can't remember that discus= sion nor the feeling that
resulted from it, but regardless of what I may= have argued for in that
discussion (if I was part of it) looking at the= above scheme I don't think I
like it or think it would be helpful.
<= br>For starters in my opinion xparse is a module made to largely mimic the = look
and feel of current 2e document level approach and what you describ= e here is a
strong deviation from that. (this is independent of the fatc= that there may be
a completely different approach to document level syntax, eventually, but this
is not what xparse was meant to be).=

In a syntax of that sort, there needs to be good ways to naturally = break up a
command and its arguments in different lines and a natural wa= y to do that is
to break between arguments (rather than inside) often ev= en putting longer ones
on single lines,eg

  \foobarbaz {aaa= aaaaaaaaaaaaaaaaaaaaaa}
             = [bbbbbbbbbbbbbbbbbbbbbbbbb]
            &= nbsp; [ccc]

or even

  \foobarbaz
    {aaa= aaaaaaaaaaaaaaaaaaaaaa}
    [bbbbbbbbbbbbbbbbbbbbbbbbb]
&n= bsp;   [ccc]

To be forced to keep the arg boundaries on a sing= le line or add %s all over
the place is just not the way people currentl= y use LaTeX (besides I think it
rather looks fairly ugly and unreadable)= .

And 2e is consistent here. They only well-known exception is \\ in the amsmath
reimplementation. To my knowledge this is really t= he only exception - if I'm
wrong please somebody tell me what else is no= t following the general skipping
of spaces scheme.

Now one could = argue that that this  behavior for \\ is useful (especially in
math= for which amsmath reimplements it) but realistically what are the otherplaces that need this kind of behavior?

The problem is this type of= behavior is really most wanted in fairly simple
commands, say with just= one optional argument or just a single star plus
perhaps optional argum= ent. And there you run into the snag that you either
have to implement a= full blown scanner yourself and  disable TeX's internal
scanner co= mpletely (such as turning anything into catcode 13 and assemble
everythi= ng yourself). Of course that is possible, but ...

If you don't want = to go that far then commands like \linebreak etc will always
suffer from the fact that there will be spaces allowed between t= hem and a
following [.

And in fact the general sentiment of this = all needs to be configurable
individually for any command is in my opini= on a bad guide. It just mean that
nobody knows what will happen on many = commands as there is no rule other than
looking up how there are defined= . And in my opinion this makes up an ugly user
interface.

here i= s my summary

allow spaces but not \par between arguments
=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

pros
- consiste= nt
- like 2e
- easy to remember
- makes for readable sources on= the whole

cons
- would not support the \\ case as implemented b= y amsmath


do not allow spaces between arguments
=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D

pros
- consistent
- easy to remembe= r
- would support the \\ case as implemented by amsmath

cons
= - completely different to 2e behavior
- makes for fairly unreadable sour= ces on the whole


leave it to the command how spaces between argu= ments are interpreted
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D

pros
- would support the \\ case as implemented by amsmat= h
- makes for fairly unreadable sources on the whole

cons
- = inconsistent interface
- difficult to remember how individual commands = behave
- more likely to intorduce errors where you find argumnts ending= up in text
by mistake


> So looking again at this I think= we should 'follow TeX', and be
> consistent in skipping spaces in a= ll cases. I don't like the fact that
> at present there is a somewha= t convoluted explanation of the behaviour
> in the xparse documentat= ion: this tends to show up when something is not
> really correct! (= At the same time, the implementation would be slightly
> easier to follow if this change was made.)
>
= > Does this seem reasonable?

to me yes.

There would still= be the question of control symbols viz control words. By
default a cont= rol symbol (e.g., \? \/ ...) will not skip spaces and \\
actually explic= itly has code to scan and ignore spaces so was deliberately put
into the= command class by Leslie to get a consistent interface for his main
comm= ands (and amsmath changed it back).

But I find a single exception (i= f implemented) still preferable to the other
options.

frank
--0-99627480-1305493460=:31292--