0

I just found the usage of <sup> in a SO question to give superscripts as follows:

y = x2 + 4*x - 5

This seems to be useful. I was wondering in general what markup language this is?

Also if I make it code, the <sup> won't work:

y = x<sup>2</sup> + 4*x - 5

Any way to make the markup and code sample work together?

0

2 Answers 2

4

Stack Overflow uses Markdown, with support for a limited selection of HTML.

You can find additional information on formatting your posts in these links:

You can make html work in a code block by using <pre> (or <code> for an inline code block) tags instead of indentation or backticks to mark it.

So this:

<pre>y = x<sup>2</sup> + 4*x - 5</pre>

Will render like you want:

y = x2 + 4*x - 5
3
  • Did you insert the last <code></code> on purpose?
    – Maroun
    Commented Feb 17, 2016 at 15:09
  • @MarounMaroun Whoops. No I did not. Fixed now.
    – resueman
    Commented Feb 17, 2016 at 15:10
  • 1
    Cool. Now I can die in peace ;)
    – Maroun
    Commented Feb 17, 2016 at 15:11
6

It's not markdown as used in the Stack Exchange editor, but a plain HTML tag.

The Stack Overflow markdown allows to incorporate certain HTML tags.

Any way to make the markup and code sample work together?

No, not unless you make the code section using HTML as well:

<pre>y = x<sup>2</sup> + 4*x - 5</pre>
y = x2 + 4*x - 5
3
  • 3
    htML is by definition a Markup Language. So it is markup.
    – Liam
    Commented Feb 17, 2016 at 15:07
  • 1
    @Liam Valid nitpick. Commented Feb 17, 2016 at 15:08
  • Ha ha, sorry.. :)
    – Liam
    Commented Feb 17, 2016 at 15:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .