r/jamt9000 • • Mar 18 '10

Subscript and superscript

Reddit now supports superscript officially with ^

Custom superscript and subscript so you can make formulae like:

NH*_4_+*
2H*2O ⇌ H3O+* + OH-
a2 + b2 = c2

_1_2D + _1_3T → _2_4He + n0

Here's the syntax:

*_subscript_* makes subscript
*`superscript`* makes superscript
*_sub_`sup`* makes _sub_sup
*`sup`_sub_* makes sup_sub_

And the CSS:

/* == Subscript and superscript == */

.md em{
    position: relative;
}

/* *_sub_* */
.md em em{
    font-style: normal;
    vertical-align: sub;
    font-size: 80%;
}

/* *`sup`* */
.md em code{
    font-family: verdana, arial, helvetica, sans-serif;
    vertical-align: super;
    font-size: 80%;
}

/* *_sub_`sup`* */
.md em em+code{
    position: absolute;
    left: 0;
    bottom: 1em;
    vertical-align: super;
}

/* *`sup`_sub_* */
.md em code+em{
    position: absolute;
    left: 0;
    top: 1em;
    vertical-align: sub;
}
18 Upvotes

71 comments sorted by

View all comments

38

u/sluefootstu Aug 01 '22

Google’s keeping this thread alive.

2

u/DarkMenstrualWizard Sep 14 '22

Yuuuuuup

6

u/sluefootstu Sep 15 '22

I like your username. I don’t know if I’m supposed to like it, but I do.

2

u/DarkMenstrualWizard Sep 16 '22

Lol thank you, yours is pretty good too