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 p088LJoM025670 for ; Sat, 8 Jan 2011 09:21:20 +0100 Received: (qmail 23543 invoked by alias); 8 Jan 2011 08:21:13 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 08 Jan 2011 08:21:13 -0000 Received: from relay.uni-heidelberg.de (EHLO relay.uni-heidelberg.de) [129.206.100.212] by mx0.gmx.net (mx043) with SMTP; 08 Jan 2011 09:21:13 +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 p088JVSi012896 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 8 Jan 2011 09:19:32 +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 p07N16dg015485; Sat, 8 Jan 2011 09:19:30 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 802120 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Sat, 8 Jan 2011 09:19:30 +0100 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 p088JUD2023275 for ; Sat, 8 Jan 2011 09:19:30 +0100 Received: from mail-pz0-f49.google.com (mail-pz0-f49.google.com [209.85.210.49]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id p088JOcs008781 for ; Sat, 8 Jan 2011 09:19:28 +0100 Received: by pzk30 with SMTP id 30so5025186pzk.22 for ; Sat, 08 Jan 2011 00:19:23 -0800 (PST) Received: by 10.142.166.15 with SMTP id o15mr2374175wfe.429.1294474763742; Sat, 08 Jan 2011 00:19:23 -0800 (PST) Received: from [10.0.1.108] (219-90-227-206.ip.adam.com.au [219.90.227.206]) by mx.google.com with ESMTPS id x18sm3879100wfa.23.2011.01.08.00.19.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 08 Jan 2011 00:19:22 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1081) References: <7255173980814043.WA.blflatexgmail.com@listserv.uni-heidelberg.de> X-Mailer: Apple Mail (2.1081) X-Spam-Whitelist: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id p088JUD2023276 Message-ID: Date: Sat, 8 Jan 2011 18:49:15 +1030 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Will Robertson Subject: Re: Verbatim and xparse (yet again :) To: LATEX-L@listserv.uni-heidelberg.de In-Reply-To: <7255173980814043.WA.blflatexgmail.com@listserv.uni-heidelberg.de> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=5D7Q89H36p4U4jfdfC5HDevlx1X2sAZgP9e9F2VTUYI/FLDAh5vXTVin+wznIYULO4W8f iu4UIHVeutAdNYNyhIIRpjhB4NMqCt7OvFNAZ3Em9oZmuR2zOKGeZpAGdnSMvI6CR2LHXlIcSoSO ckeoA==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: 6550 Hi Bruno, Thanks for writing; it's nice to hear from you. First question: why the name \cprotect? I.e., what does the "c" stand for? On 08/01/2011, at 5:55 PM, Bruno Le Floch wrote: > It might be possible to do error checking: each `\cprotect` should check > somehow that it is "at the top" (i.e., it is the first one to look at its > argument), or that it is within a `\cprotect`ed command. > Any idea how to do that? Would it work to make \cprotect an \outer macro, then when it performs its \scantokens on its arguments it can redefine itself to be non-outer in this case? For the more generic case when you need to have \cprotect\foo{...\cprotect\bar{...\cprotect\baz{...}...}...} I don't imagine there's a way to ensure the \cprotect is present at every nesting level. (Although I suppose it would be possible to have a messy token-by-token scanning routine (a la ted.sty) in which you insert \let\cprotect\cprotecterror after every open brace and \let\cprotect\cprotectnormal after every close brace in a token list, all of which to be reverted iff \cprotect is in charge of the inner brace scanning.) > For the syntax, the naive thing is to simply get `\cprotect` to grab all > the arguments verbatim, and reread them when needed, but for > performance reasons, it could be better to say explicitly for each > argument whether it needs `\cprotect`ion. Any suggestions for the > syntax in this case? I'm not really sure if this is needed. \scantokens shouldn't add much performance penalty, but you'll still need some syntax to indicate how many arguments are being included in the \cprotect. E.g., if you wrote \cprotect\section[...\verb|#&!|...]{...\verb|#&!|...} How does \cprotect know what to read in? > PS: Also, a small crazy idea (I see no practical application for that): > In LaTeX3, we can generate variants of macros with different types > of arguments (using \cs_generate_variant:Nn). Could/should the > same thing be done at the layer above? In other words, should it be > possible to take a DocumentCommand, and change the delimiters, or > change an argument from being optional to being mandatory, or from > being mandatory to being optional with default, ...? I can't see this being very useful at all :) Cheers, -- Will