Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by h1439878.stratoserver.net (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id t1CLOxDj014889 for ; Thu, 12 Feb 2015 22:25:00 +0100 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx003) with ESMTPS (Nemesis) id 0LlYRT-1Xm8bS1N0p-00bL0B for ; Thu, 12 Feb 2015 22:24:53 +0100 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 t1CLMnIY014930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Feb 2015 22:22:49 +0100 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id t1CFdrrd010977; Thu, 12 Feb 2015 22:22:49 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 11766750 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Thu, 12 Feb 2015 22:22:49 +0100 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id t1CLMmuB028011 for ; Thu, 12 Feb 2015 22:22:48 +0100 Received: from smtp1.easily.co.uk (smtp1.easily.co.uk [91.194.151.16]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id t1CLMSCJ004099 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 12 Feb 2015 22:22:32 +0100 Received: from [86.184.149.148] (port=58823 helo=Palladium.home) by smtp1.easily.co.uk with esmtpa (Exim 4.43) id 1YM1DQ-0005fy-DC for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Thu, 12 Feb 2015 21:22:28 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 References: <54D75835.1070804@morningstar2.co.uk> <54D7E011.2080604@morningstar2.co.uk> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Message-ID: <54DD1993.70905@morningstar2.co.uk> Date: Thu, 12 Feb 2015 21:22:27 +0000 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Joseph Wright Subject: Re: expl3 case changing functions To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <54D7E011.2080604@morningstar2.co.uk> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:sdlAsA/UATw=:nye37L9k0rmSG6hNJbGpW+tXpT t5BGt0wxUO+400FwWKGqE/6BryuYrntC4mAuHGeoBh64/BSlG8vCDAfaa8/jX8p/Acph/Wdy4 0rZhV1kvbzaVrSyqe9nLSQYFvMmcJPK1WaCDuZ3s4VEUsSK1U8Xi78HTJ3KzSN7G6PlyfrrH0 jwA989MQo4b5yuBM0zBvvAIKn3QwP+xdZq5b7WKw6WyelL6mdMuxC3W9Lt+1vt0AhSLN6v3LT U0Fiw/+N9A0TBNyNHafxM9G7hGFaorpQ1fmqGCiUet+rbFlgFIaz/B8KsshtwjyI6CLw8xUlt 1hPgcEcf/ac9BIfA8SponHUNM2W+AgVlphfUjZknoelsX2aWVvZxGG0uS4+GJkNuONSrX3ZVV gN2qqQPbIX0E3E3WjM+ElFKuYu0aze5TtABiUz1Rd00ZV52Nh3zQ0aujma8uPr1vE6EEcIK7p Xqiq9p4OW1oeo4tcT7ITWE49nn5l0LAoGoDj3LsGvmsPxwu7ws60lSLWZqLtudKilepBTUETt Ib0U6bKYwA/sQH7Cj9b2VH3Ah9L4SwkL1Uf8NMZABX68VSDF5pqyt2vBSatJZZxcKaDFwIhB4 JabgxIL710hp8KM9xA7JGD4XtXir3NwWt+O42DfDBFxNG5208K3kfqu1hO6NpDtu4urIKIHPn vntGP57C8/Nclpmc6HdSisv1/eCynVxdIIkCjldlUtU4AjEtC/SXusk3of8zSCTCIm8vg79rF 4yBmq9lWNUKbj7F81fHWb2auIkTySvZM/QhNgfyzQZ2eT+BGk7+/sZWm7c/qgMJREaqOweOLl acep+NxpyMT9vieNS/iWeIKLcWYf5FAaZrSQlTfFOt8JOa3xid/UJxoPGEKg3jLN3i5tlq71P gU0uECyeAxha9rJTyhfq/dAbttIEMFDEgMIswL3L008JXI26SHXasW33Ge8TLOCTdiiM1aisF ekXBE9e6NfrMVwtakqiz2GqyKaud9vqagTNaSDvrb044PUQ56ZpFoFlLVUzbnN80DUlkS1AP4 Nywo1ap5oStmt+rVhdcdsp9qq8AOgzl9npVBKOop8LmZrTakQXkI+gx7WuNjX+yy4GAH1oKMx c5YskNV1tG8WUmY7vL65498gQXC2Sg0ER084PR5yIiwihaEyEpzSw2fLgUcf58gh4Kqn/rULB 8gwsNk6T8n3J7q6Qmzo9V5J1KAlO4qe0SjvWjlmEwanQliqdqxw4mO7PgC4gAmSGVxSpTjLxZ c6a1Pw5cBDRBrj07d7rY8ooVntk4cio5jpFil6nxmJUfCP0K6R29adNvyh028mXyBq4j6qo09 bALs0V4wKjmoIVXf/73ECd1HbV2Gow0ime8jfvqMCAg6Py5sQRYeeIjai9AK7zL/AcLVqVD5g 6oAWmUqBfIIvulga03AcCeG16jig49I04LTfHy03d1EArhyRY7Q8wiM1Ha7otoPMCw/udxL9+ QgHrXN6a1XotUG3JIUiiyCn/eUv5WwhNGVx34M92T7S2Cpe50c94PaBqdLVLNUEYDWyedErg= = X-UI-Loop:V01://TI3dkjqbY=:dG2BM8JabeJwPOtXFzvWm4EoNvOYCEcgeq37Lj260FQ= X-UI-Out-Filterresults: notjunk:1; X-Scanned-By: MIMEDefang 2.71 on 85.214.41.38 Status: R X-Status: X-Keywords: X-UID: 7646 On 08/02/2015 22:15, Joseph Wright wrote: > *Escaping from case changing* > > David Carlisle points out that using the BibTeX-like approach leaves a > problem with ligatures. Whilst input such as > > {Text} > > rather than > > {T}ext > > does help, the alternative route taken by textcase > > \NoChangeCase{Text} > > allows for the 'escape' mechanism to be entirely transparent at the > typesetting stage (as the appropriate commands can be equivalent to \use:n). > > Barbara Beeton provides a useful example where a brace group is > 'trapped' inside a word with the BibTeX-like scheme as for example > > MacArthur => MacARTHUR > > requires input > > M{ac}Arthur > > with the current set up and this cannot be done to avoid a ligature break. > > I am therefore minded to alter the approach in this area to follow > textcase: such a change will if done include adding a sensible set of > standard commands to the 'ignore list' (\label, \ref, ...). > > Adopting a texcase-like approach also suggests that automatically > handling math mode might be desirable: a first pass for that might well > be based on matching single-token delimiters ($...$/\(...\) as standard > settings) with logic that more complex arrangements will be best covered > by the \NoChangeCase concept. > > *Expandability* > > One approach suggested (again by David C.) to this area is to start with > an assumption of e-TeX (\robustify for the etoolbox package for example > can be used to make existing commands e-TeX protected). With that > assumption, it is relatively straight-forward to expand 'variable-like' > macros and leave 'command-like' ones alone. (I already have code that > does much the same in siunitx.) > > Retaining an expandable approach does seem sensible as it allows what > many other languages do: case changing in a 'functional' sense (or > rather as a macro language in an x-type expansion sense). As already > noted, the need for contextual case mappings means that using the TeX > primitives directly still requires a separate mapping phase and so > performance issues are not so significant. > > *LICR/Non-native input* > > As the code here is being developed primarily for use to support future > work, and that will increasingly mean Unicode-native engines, comments > here suggest sticking to the 'ASCII/Unicode' line taken to date. As > such, pdfTeX use with non-ASCII input will need pre-processing via > \protected@edef as suggested to produce LICR data which can be handled > correctly. > > Depending on other feedback, I will likely implement the above changes > over the coming days and then look to update the release code. Based on the above I have reworked parts of the logic for these functions. The logic is now that case changing happens for all content except where excluded either by being in math mode or by being given as the argument to a list of special 'exclude' functions. This approach is closely modelled on David Carlisle's textcase package. As such, something like \ExplSyntaxOn \tl_put_right:Nn \l_tl_case_change_exclude_tl { \NoCaseChange } \cs_new_eq:NN \NoCaseChange \use:n \cs_new_eq:NN \MakeTextUppercase \tl_upper_case:n \ExplSyntaxOff \MakeTextUppercase {% abc\ae\ \( a = b \) and $\alpha \neq a$ or even \ensuremath{x=y} and $\ensuremath{x=y}$% } will yield ABC\AE \ \( a = b \) AND $\alpha \neq a$ OR EVEN \ensuremath {x=y} AND $\ensuremath {x=y}$ (example taken verbatim from textcase manual). The functions remain x-type expandable and will expand any content in the argument in non-protected macros. (Note: e-TeX protection is required for this.) I will update CTAN shortly to allow wider testing of the new code. -- Joseph Wright