Maintaining correct spacing around operators
I am not quite sure, if I correctly understuud your ultimate aim. I take it that you will only use the expressions for demonstration in a notebook or as a part of an image (say, graphics). If this is true, may be using Spacer
may help. Let us take your example with and without the spacer:
Row[{"a", "\[Times]", "b"}]
Row[{"a", Spacer[2.5], "\[Times]", Spacer[2], "b"}]
it yields
the second example has somewhat larger spaces between the symbols. One can do the same also by using the BoxLanguage:
StyleBox[RowBox[{"a", Spacer[2.5], "\[Times]", Spacer[1], "b"}],
SpanMaxSize -> Infinity] // DisplayForm
I hope it helps. Have fun!
You can also use the option you mentioned, AutoSpacing
. This is an option for Cell
, so we must use DisplayForm
to show the result in the notebook:
DisplayForm[
Cell[BoxData@RowBox[{4, "\[Times]", SuperscriptBox[10, 5]}], AutoSpacing -> True]
]