Discussion:
Non-italicized superscript
(too old to reply)
Roy Chan
2004-06-19 11:35:32 UTC
Permalink
Hi,

The standard way to type superscript in LaTeX is through the math mode, but
that will create italicized superscript. Is there a way (apart from using
\raisebox myself) to type non-italicized one?

Thanks a lot.

Roy
Morten Høgholm
2004-06-19 12:16:34 UTC
Permalink
Post by Roy Chan
Hi,
The standard way to type superscript in LaTeX is through the math mode, but
that will create italicized superscript. Is there a way (apart from using
\raisebox myself) to type non-italicized one?
The Latex kernel defines \textsuperscript as

\DeclareRobustCommand*\textsuperscript[1]{%
\@textsuperscript{\selectfont#1}}
\def\@textsuperscript#1{%
{\***@th\ensuremath{^{\mbox{\fontsize\***@size\z@#1}}}}}

so one could make a \textsubscript like this:

\DeclareRobustCommand*\textsubscript[1]{%
\@textsubscript{\selectfont#1}}
\newcommand*{\@textsubscript}[1]{%
{\***@th\ensuremath{_{\mbox{\fontsize\***@size\z@#1}}}}}

Remember \makeatletter and \makeatother around the definition if you're
not putting it in a package.
--
Morten Høgholm
I haven't got a smelly address.
UK-TUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
Björn Pedersen
2004-06-19 12:58:34 UTC
Permalink
Post by Morten Høgholm
Post by Roy Chan
Hi,
The standard way to type superscript in LaTeX is through the math
mode, but
that will create italicized superscript. Is there a way (apart from using
\raisebox myself) to type non-italicized one?
The Latex kernel defines \textsuperscript as
\DeclareRobustCommand*\textsuperscript[1]{%
\DeclareRobustCommand*\textsubscript[1]{%
Remember \makeatletter and \makeatother around the definition if
you're not putting it in a package.
which is already in the KOMA-classes and available by subscript.sty

Björn
Roy Chan
2004-06-19 13:50:26 UTC
Permalink
Thanks a lot. Didn't know it's so straightforward.

Roy
Post by Björn Pedersen
Post by Morten Høgholm
Post by Roy Chan
Hi,
The standard way to type superscript in LaTeX is through the math
mode, but
that will create italicized superscript. Is there a way (apart from using
\raisebox myself) to type non-italicized one?
The Latex kernel defines \textsuperscript as
\DeclareRobustCommand*\textsuperscript[1]{%
\DeclareRobustCommand*\textsubscript[1]{%
Remember \makeatletter and \makeatother around the definition if
you're not putting it in a package.
which is already in the KOMA-classes and available by subscript.sty
Björn
Morten Høgholm
2004-06-19 22:27:28 UTC
Permalink
On Sat, 19 Jun 2004 14:58:34 +0200, Björn Pedersen
Post by Björn Pedersen
which is already in the KOMA-classes and available by subscript.sty
It just dawned on me that I totally misread his question. Somehow I
thought he asked for a subscript... I'm getting old. Btw I just saw that
memoir provides the subscript as well.
--
Morten Høgholm
I haven't got a smelly address.
UK-TUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
Walter Schmidt
2004-06-19 13:44:58 UTC
Permalink
Post by Roy Chan
Hi,
The standard way to type superscript in LaTeX is through the math mode, but
that will create italicized superscript. Is there a way (apart from using
\raisebox myself) to type non-italicized one?
In text mode (as opposed to formulas) use \textsuperscript{...}.
This is a standard LaTeX feature.

Walter
Loading...