|
From: | Per Bothner |
Subject: | Re: real subscripts and superscripts? |
Date: | Thu, 27 Nov 2014 22:54:47 -0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
On 11/27/2014 04:13 PM, Karl Berry wrote:
Per and all, In TeX inside @math: ^{TEXT} In TeX otherwise: use a macro ... I'm thinking that TeX, either inside or outside @math, should treat TEXT as text, not math. That is, if you simply want to produce the math expression a-to-the-power-of-b, you'd write @math{a^b}, rather than @address@hidden The difference is whether b is typeset in math italic or roman. After all, sometimes people want to typeset a word in math, as in @address@hidden This seems more consistent with the treatment in the other output formats. Also, since there's already a way to get math super/subscripts, but no way to get text super/subscripts, we might as well provide something new.
Supposed I want to write a formula like e=mc^2 in TexInfo. In TeX I'd like it to be typeset $e = mc^2$. In HTML I'd like it to be typeset <span class="math">e = mc<sup>2</sup></span> or similar - i.e. I want to use <sup>2</sup>. Likewise for DocBook and XML. How would you express this in texinfo? With your proposal I'd have to write something like: @iftex @math{e=mc^2} @end iftex @ifnottex @address@hidden @end ifnottex This is painful, though I guess you could write a macro: @iftex @macro mathsup{THING} ^\THING\ @end macro @end iftex @ifnottec @macro mathsup{THING} @sup{\THING\| @end macro @end ifnottex It seems kind of klunky. I suspect most of the time if you have @sup{TEXT} TEXT is a single number, symbol, or lesser, so you'd probably want it to be in math italic. For the rare cases where you *don't* want math italic, an idea is to use @asis. I.e. @address@hidden means typeset TEXT raised and smaller but in a roman font. OTOH for most people it won't really matter is TEXT is math italic or roman. What they want is to be able to write @sup{TEXT} and have it come out as a superscript and not looking to weird. It just seems to be that @sup{TEXT} inside @math using math italic is more likely to be what you want - most of the time. It seems a more robust default. People who don't want math italic formatting would probably not use @math. Or use @asis to override mathe styling. -- --Per Bothner address@hidden http://per.bothner.com/
[Prev in Thread] | Current Thread | [Next in Thread] |