Superscript in Markdown (Github Flavored)?

Following this lead, I tried this in a Github README.md:

<span style="vertical-align: baseline; position: relative;top: -0.5em;>text in superscript</span>

Does not work, the text appears as normal. Help?

1

4 Answers

Use the <sup></sup>tag (<sub></sub> is the equivalent for subscripts). See this gist for an example.

4

You have a few options for this. The answer depends on exactly what you're trying to do, how readable you want the content to be when viewed as Markdown and where your content will be rendered:

HTML Tags

As others have said, <sup> and <sub> tags work well for arbitrary text. Embedding HTML in a Markdown document like this is well supported so this approach should work with most tools that render Markdown.

Personally, I find HTML impairs the readable of Markdown somewhat, when working with it "bare" (eg. in a text editor) but small tags like this aren't too bad.

James H. Sterling

James H. Sterling

Environmental Science & Climate Journalist

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.