public
Last active

Cell expressions for different ways of writing text superscripts in Mathematica: http://stackoverflow.com/q/3860574/421225

  • Download Gist
H30+
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
Cell[TextData[{
"the chemical formula for hydronium is H",
Cell[BoxData[
FormBox[
SubscriptBox["\[Null]", "3"], TraditionalForm]],
FormatType->"TraditionalForm"],
"O",
Cell[BoxData[
FormBox[
SuperscriptBox["\[Null]", "+"], TraditionalForm]],
FormatType->"TraditionalForm"],
" \ncompare with the formating if the whole expression is in \
mathmode: ",
Cell[BoxData[
FormBox[
RowBox[{
SubscriptBox["H", "3"],
SuperscriptBox["O", "+"]}], TraditionalForm]],
FormatType->"TraditionalForm"],
"\nthis is in mathmode, but with italics removed and a negative \
space: ",
Cell[BoxData[
FormBox[
RowBox[{
SubscriptBox[
StyleBox["H",
FontSlant->"Plain"], "3"], "\[NegativeVeryThinSpace]",
SuperscriptBox[
StyleBox["O",
FontSlant->"Plain"], "+"]}], TraditionalForm]],
FormatType->"TraditionalForm"]
}], "Text"]

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.