XeTeX, however, has prepared some macros for this. Assuming you have
\usepackage{xltxtra}
in the preamble, you can use the commands\textsubscript{}
\textsuperscript{}
if you want something like
C_2
you write C\textsubscript{2}
. Of course if you use this a lot, it is much more convenient two write some shorthand command to use instead these long ones.Those of you who still write in LaTeX may find a solution here.