How to do superscripts and subscripts in Jupyter Notebook?

PraveenHarris picture PraveenHarris · Sep 2, 2017 · Viewed 31.8k times · Source

I want to to use numbers to indicate references in footnotes, so I was wondering inside of Jupyter Notebook how can I use superscripts and subscripts?

Answer

James Draper picture James Draper · Sep 2, 2017

You can do this inside of a markdown cell. A markdown cell can be created by selecting a cell then pressing the esc key followed by the M key. You can tell when you have converted a cell to markdown when In [ ]: seen to the right of the default code cell is gone. Then you can input the following code that uses latex with markdown to represent sub/super-scripts:

Latex subscript:

$x_{2}$

Latex superscript:

$x^{2}$

You can find more detailed examples here.

Please comment below if you are still having difficulty.