Subscript and Superscript

On this page, you’ll learn:

  • How to mark up a subscript character or word with AsciiDoc.

  • How to mark up a superscript character or word with AsciiDoc.

You can write equations and formulas with AsciiDoc using the stem document attribute.

Subscript syntax

Text is subscripted when enclosed in a set of tildes (~).

Example 1. Subscript
The chemical formula for water is H~2~O.

The result of Example 1 is rendered below.

The chemical formula for water is H2O.

Superscript syntax

Text is superscripted when enclosed in a set of carets (^).

Example 2. Superscript
What is the answer to E=mc^2^?

The result of Example 2 is rendered below.

What is the answer to E=mc2?