I am trying to have the symbol $\epsilon_{9/2,4}^-$ as the axis label in a graph in Mathematica. First problem is that: when I use Subscript[$\epsilon$,9/2,4], 9/2 changes to $\frac{9}{2}$ (which I don't want, because it doesn't look good). Second problem is that Subscript[$\epsilon$,9/2,4]^- does not work. Can anyone please let me know how to do this? Thanks!

  • 1
    $\begingroup$ OK, I found the answer. This works Subscript[ϵ,"9/2",4]^"-". So, please ignore this question. $\endgroup$ – Farokh May 15 '13 at 19:04
  • 1
    $\begingroup$ maybe you want to look at Subsuperscript[\[Epsilon], "9/2,4", "-"] $\endgroup$ – Pinguin Dirk May 15 '13 at 19:47
  • $\begingroup$ "OK, I found the answer." - please write an answer to your own question. $\endgroup$ – J. M. is in limbo May 16 '13 at 1:58

One very robust way to do such things is using the BoxLanguage of Mma. Your task for example is solved by the construct:

SubsuperscriptBox["\[Epsilon]", "2.4", "-"] // DisplayForm

placed just where you enter the desired AxesLabel. It can be, however, styled in addition, for example, as follows:

    StyleBox[SubsuperscriptBox["\[Epsilon]", "2.4", "-"], 
  FontColor -> Red, FontSize -> 18, FontWeight -> Bold] // DisplayForm

I will give below the example of its use for formatting the axes labels, by fromatting them differently (e.g. different colors, fonts and fixing FontWeight):

    Plot[Sin[eps], {eps, 0, 3}, 
 AxesLabel -> {StyleBox[SubsuperscriptBox["\[Epsilon]", "2.4", "-"], 
     FontColor -> Red, FontSize -> 18, FontWeight -> Bold] // 
   StyleBox[SuperscriptBox["x", "y/z"], FontFamily -> "Mathematica6", 
     FontSize -> 18, FontColor -> Blue, FontWeight -> Bold] // 

This returns the following plot: enter image description here

I organized these constructs in such a way that one may use them without knowing anything else about the BoxLanguage. Have fun!


I just wanted to provide this with a complete answer, since I had this very same question. There are two ways to enter both a sub and a superscript, one using the Subsuperscript command (as noted by @Pinguin Dirk), and one using shortcut keys, which is described in the help:

To enter a subsuperscript in a notebook, use either Ctrl+_ to begin a regular subscript or Ctrl+^ to begin a regular superscript. After typing the first script, use Ctrl+% to move to the opposite script position. Ctrl+Space moves out of the subscript or superscript position.

Using the shortcut keys enables one to actually have the subsuperscript style while typing, rather than just as an output.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.