Exponents in LaTeX without Math Mode
11,749
Solution 1
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.
Solution 2
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.
Related videos on Youtube
Comments
-
Desert Digital almost 2 years
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.
-
user2314737 over 6 yearsYou can enclose inline formulas in a single
$
-
MattAllegro over 6 years
-
-
Andrew Swann over 6 years
\textsuperscript
has been in the kernel since 1995.fixltx2e
added\textsubscript
in 2005; that command got moved in to the latex kernel at the end of 2014.