Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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!

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

2 Answers 2

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] // 
    DisplayForm, 
   StyleBox[SuperscriptBox["x", "y/z"], FontFamily -> "Mathematica6", 
     FontSize -> 18, FontColor -> Blue, FontWeight -> Bold] // 
    DisplayForm}]

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!

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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