Creating subscripts without italics

8,370 views
Skip to first unread message

Gerry Wolff

unread,
Sep 13, 2009, 3:58:19 PM9/13/09
to LaTeX Users Group
If I put $CO_2$ into a Latex source file, it produces CO2 with the '2'
as a subscript, but it also puts the whole text into italics!

I would like CO2 to be written with '2' as a subscript, but without
the text being in italics.

Can anyone tell me how this can be done?

Werner Grundlingh

unread,
Sep 13, 2009, 4:15:06 PM9/13/09
to LaTeX Users Group
LaTeX automatically assumes that C & O in $CO_2$ are variables, and
require some spacing between them. You might notice a difference in
the spacing between, for example, $CO$ and \textit{CO} and/or {\it
CO}, just because the last two are in text mode, while the first is in
math mode. Regardless, if you want upright (or text mode) letters in
you math mode environment, use
#\mathrm{CO}_2$

Werner

Vahid Damanafshan

unread,
Sep 13, 2009, 4:17:31 PM9/13/09
to latexus...@googlegroups.com
Use $\mathrm{CO}_2$.
--
---------------------------------------
وحید دامن‌افشان
Vahid Damanafshan
vdaman...@yahoo.com
vdaman...@gmail.com

jon

unread,
Sep 13, 2009, 6:38:38 PM9/13/09
to LaTeX Users Group
On Sep 13, 3:58 pm, Gerry Wolff <gerrywolf...@googlemail.com> wrote:
> If I put $CO_2$ into a Latex source file, it produces CO2 with the '2'
> as a subscript, but it also puts the whole text into italics!
>
> I would like CO2 to be written with '2' as a subscript, but without
> the text being in italics.

memoir provides the commands:
\textsuperscript % which exists in, e.g., the article class
\textsubscript

which you can use outside math mode. if you want to emulate memoir's
textsubscript command, you could do:

\usepackage{relsize}
\newcommand{\subscript}[1]{\raisebox{-0.25em}{\smaller #1}}

cheers,
jon.
Reply all
Reply to author
Forward
0 new messages