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 p0TAQoKF030185 for ; Sat, 29 Jan 2011 11:26:51 +0100 Received: (qmail 21290 invoked by alias); 29 Jan 2011 10:26:45 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 29 Jan 2011 10:26:44 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx078) with SMTP; 29 Jan 2011 11:26:44 +0100 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 p0TAOqRH030710 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 29 Jan 2011 11:24:52 +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 p0T7Ugv9012767; Sat, 29 Jan 2011 11:24:52 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 993726 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sat, 29 Jan 2011 11:24:52 +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 p0TAOqPu004216 for ; Sat, 29 Jan 2011 11:24:52 +0100 Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.23]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with SMTP id p0TAOeOM030461 for ; Sat, 29 Jan 2011 11:24:44 +0100 Received: (qmail invoked by alias); 29 Jan 2011 10:24:40 -0000 Received: from HSI-KBW-085-216-082-118.hsi.kabelbw.de (EHLO [192.168.0.197]) [85.216.82.118] by mail.gmx.net (mp011) with SMTP; 29 Jan 2011 11:24:40 +0100 X-Provags-ID: V01U2FsdGVkX1/TW9tu553T24UsxXZUj3Ncp/blzgZHl/8iD55ZQH Mrt0nBZnfmPJCc User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101230 Lanikai/3.1.7 MIME-Version: 1.0 References: <4D4331D6.7050603@gmx.de> <28C2364F-40C8-4E1D-B36F-DDA433DA1F19@gmail.com> X-Enigmail-Version: 1.1.2 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigA6C071C72B16A32397AFE082" Message-ID: <4D43EAE8.9020508@gmx.de> Date: Sat, 29 Jan 2011 11:24:40 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Arno Trautmann Subject: Re: a question of style To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <28C2364F-40C8-4E1D-B36F-DDA433DA1F19@gmail.com> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p4WX0t+AtsdW/aoqQDaDNIQ/EA7zglKqp2DNB9uS88o6l6qVhGGM5+7SEofY b0pI1frEf7Q+fCx9XPau5OCZEwE7qR2EQcZKJp0ykDMwMkMXulfBtTeqiiVD10l1zy8pKyUsFnOw XNstZkWDHwTCbScV1; 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: 6583 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigA6C071C72B16A32397AFE082 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Will Robertson wrote: > On 29/01/2011, at 9:39 AM, Bruno Le Floch wrote: >=20 >>> As this is ment for document level, I am tempted to use >>> \NewDocumentCommand. But this word is longer than the whole code of t= he >>> macro itself, that blows some simple code really up. On the other han= d, >>> using \def would be very short but is not LaTeX3-ish. \cs_new:Nn does= n't >>> let me define something without a : at the end. Or would a \tl_new be= a >>> good way? >> >> I don't know what the right way of doing things is. Two ways I can thi= nk of are >> >> \cs_new:Npn \ie {i.\,e.} >> \tl_new:Nn \ie {i.\,e.} >=20 >=20 > These commands are only intended to be used for actual package code. Fo= r my own (unpublished because it's insignificant) package for doing this,= I use \DeclareRobustCommand since I wrote it before I was using xparse. >=20 > But \NewDocumentCommand is probably the way to go, although it seems ov= er the top: (after all, consider the name -- it's for creating "document = commands") >=20 > 1. You want the "newness" checking so you don't clash with some other = possible definition of \ie >=20 > 2. For this type of macro it's often desirable to have "protected" com= mands, so that the \ie is kept as a macro inside LaTeX2e-termed "moving a= rguments" such as section headings and captions. >=20 > But a better way to do this sort of thing would be to write something l= ike >=20 > \NewDocumentCommand \NewShorthand { mm } {% > \NewDocumentCommand #1 {} {#2}% > } >=20 > so you can then write >=20 > \NewShorthand \ie {i.e.} That is not much shorter, but it is a start =85 > I actually think this idea of a "document shorthand" such as this, bein= g a macro with no arguments (or perhaps with a very simple macro replacem= ent rule -- say anything expandable that doesn't rely on counters or posi= tion in the document) should be a somewhat formal construct that we defin= e. In fact, I think it should use a different syntax than the regular "go= bble space" undelimited macro, such as the equivalent of >=20 > \def\ie/{i.e.} >=20 > which would be used in-text as "blah blah blah (\ie/, yar yar yar)" or = "blah \ie/ yar" -- in other words, spaces are preserved after the macro. = The reasoning being that (and I think I've said this before) even experie= nced LaTeX authors make mistakes with things like writing "The \LaTeX Com= panion" or whatever, and eliminating this source of error would be -- I t= hink -- a usability improvement for people that want to use it. >=20 > Perhaps a trailing semicolon would be a better idea; I'm not really sur= e what the best syntax here would be. (There is a package somewhere on CT= AN that defines shorthands using @ symbols (so you'd write, like, "@ie@")= , but that syntax might be a bit extreme for me.) What about adding something like \xspace automatically? Maybe with a *-version that does not? > But perhaps that's all being a bit prescriptionist, and just because I = like to write like that doesn't mean we should force everyone to. DocumentCommand is still available for everyone who does not want a short version =85 > But besides the interface improvement with avoiding the spaces behaviou= r, such a "shorthand" system could also be used in post-processing to con= vert a document with author shorthands into an "expanded" document that d= oesn't require the macros. cheers Arno --------------enigA6C071C72B16A32397AFE082 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1D6ugACgkQcYXUw/rerZ40HQCfW6kyACEXpPBv8M98sQnkIBSD XssAmgOkZvSIghMALPLUlRR3y65NL7zm =QNQC -----END PGP SIGNATURE----- --------------enigA6C071C72B16A32397AFE082--