Sarmate.net Sarmate.net
Home Features Pricing Documentation Contact
Log in Sign up

Writing subscripts and superscripts in LaTeX

In math mode, the _ character creates a subscript and ^ a superscript. For more than one character, use curly braces.

Simple subscripts and superscripts

LaTeX
% Exposant simple
$x^2$ \quad $a^n$ \quad $e^x$

% Indice simple
$x_1$ \quad $a_n$ \quad $H_2O$

% Plusieurs caractères : accolades obligatoires
$x^{2n+1}$ \quad $a_{ij}$ \quad $e^{-x^2}$

Combined and nested

LaTeX
% Indice et exposant sur le même élément
$x_i^2$ \quad $a_n^{(k)}$

% Imbriqués
$e^{e^x}$ \quad $x_{i_j}$

% Avec des sommes et intégrales
$\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$

$\int_0^{\infty} e^{-x} \, dx = 1$

Superscripts in text mode

Outside math mode, use \textsuperscript and \textsubscript.

LaTeX
Le 1\textsuperscript{er} janvier.

H\textsubscript{2}O est la formule de l'eau.

Try it in Sarmate

Edit, compile and download your LaTeX documents directly in your browser.

Open the editor