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

\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.

23 comments:

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.

Thanks.

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.

Unknown 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 www.uk-essay.net/custom-essay of an individual throughout their every day lives?

Anonymous said...

Wow ... great man ... thanks!

Anonymous said...

Awesome and interesting article. Great things you've always shared with us. Thanks. Just continue composing this kind of post. http://great-term-paper.com/

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

Unknown 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
wishlistr compe

Unknown said...


The use of superscripts and superscripts in the language has varied meanings. I thank the author that he has managed to outline the uses and also given some guidelines concerning this subject. I have obtained new ideas and realizations and I thank the author for the wonderful information. Product Brand Articles

Anna Howell said...

Excellent info'going to go use it right now uk essay writing

Unknown said...

Hi there, is this very much helpful post. For details or any type of query about custom writing then we are here.
Visit our site custom writing

Unknown said...

We have to know in what cases to use those subscripts and superscripts in text mode, because it seems to me sometimes it can do much harm if to use it not in a correct way! Recently, I was writing a dissertation about usage of this scripts with a help of
custom writers and this topic was really interesting to explore.

mucky duck kodi repository said...

Thank you for sharing your point of view. Keep on sharing the post. Don't forget to visit mucky duck kodi repository.

Pay per view events live stream said...

A wonderful piece of detail shared by you. I read the whole article and discovered that it is much relevant and interesting. Continue sharing this tremendous work. visit my page to know about Pay per view events live stream

Rose said...

Very helpful info specially the last part I care for such info much.

richard said...
This comment has been removed by the author.
Unknown said...

Well, amazing post i really love your blog posts thanks for sharing.

https://oneworldrental.ae/check-in-registration

Anonymous said...

thanks for sharing such amzing post check out openload

Jonathan Kim said...

In college paper writing, you might come across academic assignments that may require you to know how to write an explanatory essay. For any student, writing an expository essay can be a strenuous task. Besides the research and analysis part of the project, you will also need to write in such a way that it presents your knowledge or information for interpretation. To help you with this, we have come up with some helpful expository essay topics to guide you along. Well researched and well written, an expository essay aims to present a topic for interpretation by the reader. To learn more about writing this type of essay. All our academic writers are qualified with years of experience in writing academic essays, research papers and more. - college paper writing help.

jsampson1945 said...

The package xltxtra is not available (2021).