Superscript in Markdown
Some markdown editors allows the use of superscript, where a character is placed at a slightly upper height than the normal character or number. We need to use a caret symbol (^) before and after the text. Superscripts are commonly used in mathematics, such as representing linear equations, complex numbers, trigonometry, and differential equations.
2 is the superscript of A
The text inserted between the two caret symbols will appear as the superscript and the text before and after the two caret symbols will appear as the usual text.
There should be no space between the words, characters, symbols, or numbers placed inside the tilde symbols for superscript.
Note: There should be no space between the caret and the text. Both the symbols and the text inside it should be written without any space. Otherwise, the caret symbols will be considered as the text by default.
Normal Text Superscript
The error arises when we insert an extra space between the symbols and text.
Let's the above example.
There is one space before and after the text in both the cases.
Normal Text ~ SuperscriptText ~
Reason: The output is the same as that of input. It is due to the extra space before and after the text, which is considered as text by default.
Superscript using HTML
To use the superscript command in HTML, we need to use the <sub> tag.
<sup> ... </sup>
10 <sub> 2 <sub>
Let's discuss two example based on subscript.
X2 + 3X + 2 = 0
(Number)^0^ is always equal to 1.
and so on.