In conjunction with this answer Superscripts and subscripts in graphics causes italics Carl Woll complained about the mess of "\!\(\*SuperscriptBox[\(m\), \2\)]\)"
. This mess does not appear in my notebook but only when I have posted into Stackexchange using the uploader. Is there a way to avoid this sort of mess? I note that when I copy back into my notebook the mess stays. The suggestion to change to RawInputForm
does not seem to help. Am I missing something?
Add a comment
|
1 Answer
When you use 2D typesetting inside of a string, you will get linear syntax. Here is an animation showing an example:
It is actually rather non-trivial to convert linear syntax into normal expressions. So, in my opinion, it is preferable to avoid using 2D typesetting inside of a string. Instead use Row
or possibly StringForm
. For example:
Row[{"m ", s^2}]
StringForm["m `1`", s^2]
-
Thanks for this. The use of
StringForm
is ingenious. Only must avoid having a prior value for s!– HughCommented May 13, 2018 at 14:10 -
@Hugh It seems that using
HoldForm[s^2]
avoids that problem (but I don't know if it causes others). Commented May 21, 2018 at 1:44