Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exponents in LaTeX without Math Mode

Tags:

latex

I was wondering if there was a way to write exponents in LaTeX without Math Mode?

Math Mode centers the text in the middle of the paper, which is inconvenient for the paper I am trying to write.

like image 417
Desert Digital Avatar asked Jan 03 '23 21:01

Desert Digital


2 Answers

You can use \textsuperscript{...} outside of math mode to do this. For example:

n\textsuperscript{2} for n-squared,

n\textsuperscript{th} for n-th.

My understanding is that both \textsuperscript and \textsubscript used to be part of the fixltx2e package until 2015 when they and some other commands were added directly into LaTeX so no package was needed.

like image 85
Truman Avatar answered Jan 05 '23 18:01

Truman


I'd suggest to use $....$:

\documentclass[a4paper, ngerman, 12pt]{scrreprt}
\begin{document}
This is a blind text trying to write exponents in a textline. $a^{2}$  This is a blind text trying to write exponents in a textline.

$a^{2}$
\end{document}

The first part of the code gives you an exponent during textflow. The second part creates an exponent on the left.

like image 43
Romox Avatar answered Jan 05 '23 19:01

Romox