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 p0TB1MZF009883 for ; Sat, 29 Jan 2011 12:01:23 +0100 Received: (qmail 8122 invoked by alias); 29 Jan 2011 11:01:17 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 29 Jan 2011 11:01:16 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx040) with SMTP; 29 Jan 2011 12:01:16 +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 p0TAxSN0031196 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 29 Jan 2011 11:59:29 +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 p0T7Ugvn012767; Sat, 29 Jan 2011 11:59:27 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 993769 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sat, 29 Jan 2011 11:59:27 +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 p0TAxR2h006456 for ; Sat, 29 Jan 2011 11:59:27 +0100 Received: from mail-gw0-f49.google.com (mail-gw0-f49.google.com [74.125.83.49]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id p0TAxLA8030921 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=FAIL) for ; Sat, 29 Jan 2011 11:59:26 +0100 Received: by gwj20 with SMTP id 20so2216256gwj.22 for ; Sat, 29 Jan 2011 02:59:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.150.212.8 with SMTP id k8mr5683004ybg.60.1296298761334; Sat, 29 Jan 2011 02:59:21 -0800 (PST) Received: by 10.147.39.3 with HTTP; Sat, 29 Jan 2011 02:59:21 -0800 (PST) References: <4D4331D6.7050603@gmx.de> <28C2364F-40C8-4E1D-B36F-DDA433DA1F19@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Whitelist: Message-ID: Date: Sat, 29 Jan 2011 05:59:21 -0500 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch 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=5D7Q89H36p77e5KAPs1l6v/Sb97LojnDtMgfETrECMLUO9erHzOJe+OynZRhvlGqb5A0X bbiCt2rAnnct/NAlbHMvoAL6GY+23tB3khNK7Y6oT1sPizBjJUAOds0oJBO/5TIz9C5741aj9GOJ bE70Q==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: 6584 > I actually think this idea of a "document shorthand" such as this, being a > macro with no arguments (or perhaps with a very simple macro replacement > rule -- say anything expandable that doesn't rely on counters or position in > the document) should be a somewhat formal construct that we define. > > [snip] > > But besides the interface improvement with avoiding the spaces behaviour, > such a "shorthand" system could also be used in post-processing to convert > a document with author shorthands into an "expanded" document that doesn't > require the macros. I agree. Each author can freely input a file with his favorite shorthands. Then before sending it out to coauthors, he can cleanse it, replacing each shorthand by its definition. This would avoid having huge preambles at the beginning of a file, where in fact only a few definitions are used in the text. A less ambitious goal would be to only include those macros that are used in the text (I finally figured most of that one out). I've written last week some dirty code for replacement in TeX source. I am not yet completely sure what is possible to allow, and what is not possible. But a few thoughts: - these shorthands need to be context-independent (e.g., impossible to check whether we are in math mode or not when replacing them) - they don't really need to be expandable. For example, we can replace \foo/ by 1, 2, 3, ..., numbering the first, second,... occurences of \foo in the source. For example, it can be used for expanding acronyms with special treatment at the first occurence (of course, only do that when the text is ready). - contradicting my first point: it is possible to do something similar to "div p" in css, namely, "\def_in{document itemize}\foo/{...}" could define \foo/ to expand to {...} if it is inside an itemize environment inside the document environment. The ability to detect for example whether we are in math mode or not depends on how precise the LaTeX3 syntax is. If we require something like \DeclareMathEnvironment (or whatever), then it is easy. > \def\ie/{i.e.} > Perhaps a trailing semicolon would be a better idea; I'm not really sure Possible issue with "/": if a package tries to be clever with / in math mode, and sees / before expanding \ie, it could cause endless trouble. Bruno