Talk:Subscript and superscript: Difference between revisions

Content deleted Content added
TeX code: new section
Line 11:
Isn't there a way to get superscripts in TeX without going into a maths/equation environment? Like for "1<sup>st</sup>", for example, or "M<sup>rs</sup>". Perhaps as [[Superior letter]]?
—DIV ([[Special:Contributions/128.250.80.15|128.250.80.15]] ([[User talk:128.250.80.15|talk]]) 09:19, 30 January 2008 (UTC))
 
:No. Yes. Sort of.
 
:Superscripts as such can only be produced by TeX in math mode. You can use <code>M$^{\rm rs}$</code>, or, if you have to cope with spaces in the superscript, <code>M$^{\hbox{\scriptsize foo bar}}$</code>. There is a LaTeX macro called \textsuperscript which you can use like <code>M\textsuperscript{rs}</code>, but it actually expands to something equivalent to the \hbox \scriptsize code above (along with a lot of garbage), so it also uses math mode even if it's not apparent on the surface (and it's not really easier to type).
 
:If you ''really'' want to avoid math mode, you can try some box shuffling, such as <code>M\raise.8ex\hbox{\scriptsize rs}</code>. This solution however relies on empirical font-dependent constants (like the 0.8ex above), which makes it rather inelegant.
 
:Ordinal superscripts are bad style anyway, so the best way to write "1<sup>st</sup>" in TeX is <code>1st</code>. -- [[User:EJ|EJ]] ([[User talk:EJ|talk]]) 10:54, 30 January 2008 (UTC)