Wednesday, January 6, 2010

Subscript and superscript in text mode

I often need to write various thing in subscript and superscript which have nothing to do with maths so I don't want to have them written in math mode. For LaTeX users there is no easy way to write subscript and superscript in text mode.
XeTeX, however, has prepared some macros for this. Assuming you have \usepackage{xltxtra} in the preamble, you can use the commands


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.


steve bauer said...

Hey Sven,

Thanks for this useful tidbit.

I had been looking in my LaTeX books for a superscript command without going into math mode.


Tomas said...

Hi there. I'm using texlive in Linux and I tried to compile with latex those commands. Surprisingly they worked in LaTeX without any aditional packagages... weird eh?

Anonymous said...

I didn't have to install a new package either. This command has changed my life.

Marlon Orozco BaƱos said...

Hi, well I just have to say that --I don't know why--, in my case, the \textsuperscript command doesn't work well (for example, the "," appears in the baseline which was very ugly when I have to get two footnotes calls one just after the other). The problem for me fixed by comment the \usepackage{xltxtra} line. Curious, I think.

buy an essay papers said...

As a cultivator designer, I can say that I found here a lot. Leaves a good impression and easy navigation

Workers compensation expert said...

Good stuff, thank you.
Chris Harris

ADmin said...

Anyway what should be said of the general developments of an individual throughout their every day lives?

Anonymous said...

Wow ... great man ... thanks!

Ruben said...

Awesome and interesting article. Great things you've always shared with us. Thanks. Just continue composing this kind of post.

Maya said...

Great post, you have pointed out some excellent points, I as well believe this is a very superb website.
T20 World Cup 2016 Live

Maya Mukharjee said...

I have not heard about before. Keep sharing more blog posts on this Community and get extra benefits with this ideas and knowledge. Thanks for this one.
technocompe blogher
wishlistr compe