RE: [NTG-context] Capitalized headings
The bad news is that now I have a lot more questions concerning the
It really seems that I do... I played around with the capitalization commands and got some interesting results. My test file is (works in live.contextgarden.net if required): --- \enableregime[il1] \starttext abcABCåäöÅÄÖ \cap{abcABCåäöÅÄÖ} \uppercased{abcABCåäöÅÄÖ} \WORD{abcABCåäöÅÄÖ} \uppercase{abcABCåäöÅÄÖ} \stoptext --- So, the test string is: abcABC\aumlaut\aring\oumlaut\Aumlaut\Aring\Oumlaut (just in case it does not display correctly). It gives: \cap -> ABCABCÅÄÖÅÄÖ (in \tfx size), just as expected \uppercased -> ABCABCåäöÅÄÖ (ABC's in \tfx, rest untouched) \WORD -> ABCABCÅÄÖxxx (where xxx's are gibberish) \uppercase -> ABCABCÅÄÖxxx The plain TeX \uppercase seems to be known for its nasty behaviour with anything else than US characters. \WORD seems to be a thin wrapper around it, so similar behaviour is to be expected. \uppercased makes interesting things, as it does uppercase the abc's well but does not touch the accented characters in any way. Only \cap seems to do exactly what it should. --- Things become even stranger, when the regime is switched to UTF-8. Then \WORD and \uppercase give some errors and refuse to compile. \uppercased and \cap work as described above. --- As \uppercase is a plain TeX macro, fixing it is not a good choice, especially because it is known to be bad. However, if \WORD could be built on \cap but without the font size changing, it would work fine. The odd behaviour of \uppercased (and the reasons to use it instead of the other choices) remains unclear to me. - Ville
Ville Voipio said this at Wed, 4 May 2005 00:32:59 +0300:
As \uppercase is a plain TeX macro, fixing it is not a good choice, especially because it is known to be bad. However, if \WORD could be built on \cap but without the font size changing, it would work fine. The odd behaviour of \uppercased (and the reasons to use it instead of the other choices) remains unclear to me.
I'm not entirely sure what's going on here, either, but as you've observed, the smallcaps mechanism handles these things very robustly. I was mucking about in this area recently, so here's a hack that hooks into that mechanism (hopefully without ruining the rest of the smallcaps). Insert disclaimers here ;) \unprotected \def\useallcaps {\def\cap@@uppercase{\the\everyuppercase\uppercased}% \def\cap@@lowercase{\the\everylowercase\lowercased}% \def\cap@@visualize{}} \protected \def\CAPITALIZED#1{\bgroup\useallcaps\smallcapped{#1}\egroup} \CAPITALIZED{abcABCåäöÅÄÖ} \smallcapped{abcABCåäöÅÄÖ} \userealcaps \smallcapped{abcABCåäöÅÄÖ} This is new stuff to me, so I can't really articulate what's happening at the moment. The code in core-fnt.tex isn't too tough to follow, though, if you want to examine further. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Adam T. Lindsay, Computing Dept. atl@comp.lancs.ac.uk Lancaster University, InfoLab21 +44(0)1524/510.514 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
participants (2)
-
Adam Lindsay
-
Ville Voipio