In Mathematica v11, entering an asterisk from keyboard would be displayed as a 'times' operator, ie, it is not placed at top right corner of a text (as in Mathematica v9). I notice [Star] and [RawStar] display the same in v11 notebook.

I understand SuperStar[text] would do the trick, but is there a way to display asterisk (super star) as it enters from keyboard?

Try this in v9 and v11 and you will see the difference.

BarChart[{1, 2, 3}, ChartLabels -> {"a*", "b\[RawStar]", "c\[Star]"}]

enter image description here

  • $\begingroup$ Or is there an alternative character for asterisk? [Conjugate] looks alike but not quite right. $\endgroup$ – Leonx Dec 9 '16 at 1:35
  • $\begingroup$ If you use keyboard shortcut Ctrl+6, you can directly enter a * in superscript position. I believe this would be interpreted as SuperStart[...]. $\endgroup$ – QuantumDot Dec 9 '16 at 1:46
  • $\begingroup$ We have lots of graphing codes written in version 9 and it would be handy to display those asterisks correctly in version 11. Text with SuperStar or SuperScript doesn't look quite the same as it is with asterisk, see screenshots above. $\endgroup$ – Leonx Dec 9 '16 at 3:24
  • $\begingroup$ On OS X I get exactly the same output with v9, v10 and v11. The core reason for the star not being in a superscript isn't positioning, but fonts. Somehow Mathematica automatically uses different fonts for some characters such as *, %, etc. It doesn't do this in a text cell. It does do it in an output cell or in Text in graphics or in labels ... We need to find the style option that triggers this. $\endgroup$ – Szabolcs Dec 9 '16 at 17:00
  • $\begingroup$ Sorry guys, my exercise is on Windows 7. I guess you are right, it could be the font. $\endgroup$ – Leonx Dec 12 '16 at 3:54

This was not at all easy to figure out.

First, I do not see any difference between version 9, 10 and 11 on OS X.

But I do see a difference between a Text cell and an Output cell:

enter image description here

If you experiment for long enough, you will notice that the difference between the two * characters is not in their position but their font. In certain contexts, Mathematica simply substitutes a different fonts for certain operators, such as * or %.

After a lot of digging in stylesheets, I found that this is due to the following Cell (or Style) option:

PrivateFontOptions -> {"OperatorSubstitution" -> True}

enter image description here

The solution is to set this to False.

Now the next step is to figure out where (in which style) to set it to False. Doing it in "Graphics" isn't sufficient. I spent too much time on this already so I will leave it to others.

  • $\begingroup$ I think I have to manually or globally add this option to text style in order to get the desirable asterisks. It would be a manageable change. Thank you very much for your research. $\endgroup$ – Leonx Dec 12 '16 at 5:32

Assuming I understand the question, a fiddly or "find and replace" answer might be (changing font style as required):

BarChart[{1, 2, 3}, ChartLabels -> {Style[d^( "*"), ScriptBaselineShifts -> 0.9, 
ScriptSizeMultipliers -> 1.15], SuperStar[d], "c\[Star]"}]

enter image description here


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.