Skip to main content
1 of 2
Verbeia
  • 34.5k
  • 10
  • 110
  • 225

How can I turn off SingleLetterItalics in PlotLabels, etc, when the Options Inspector won't do it?

One of the requirements set for the graphing project I am working on is that plot and axis unit labels sometimes need to include superscripts. Here is an approximately minimal example (I have some plotting options set differently from the default, but these shouldn't matter here):

fakedata101 = 
  FoldList[0.92 #1 + #2 &, 0., 
   RandomVariate[NormalDistribution[0, 0.5], 100]];
ListLinePlot[fakedata101, Filling -> Axis, PlotStyle ->Red, 
 FillingStyle -> Red, 
 PlotLabel -> "Test Label in k(\!\(\*SuperscriptBox[\(m\), \(2\)]\))"]

enter image description here

The SingleLetterItalics option appears to be turned off in the Options Inspector, but that doesn't seem to work for String-format text labels. It does work if set explicitly, e.g. when adding Text in an Epilog with an explicit Style wrapping:

Epilog -> 
 Text[Style["\!\(\*SuperscriptBox[\(Text with Footnote marker\), \((a)\)]\)", 
   SingleLetterItalics -> False], {10, -1.5}]

Is there a way I can robustly turn off SingleLetterItalics in styled text such as this? I would prefer not to have to catch every String passed to a PlotLabel or AxisLabel and send it through a Style command if I could help it.

Verbeia
  • 34.5k
  • 10
  • 110
  • 225