Skip to content

Instantly share code, notes, and snippets.

@simonjtyler
Created October 5, 2010 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonjtyler/611053 to your computer and use it in GitHub Desktop.
Save simonjtyler/611053 to your computer and use it in GitHub Desktop.
Cell expressions for different ways of writing text superscripts in Mathematica: http://stackoverflow.com/q/3860574/421225
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"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment