Skip to main content

charts - Display asterisk as it enter in Mathematica v11


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



Answer



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.


Comments