# Sub-subscripts in strings cause different spacings than subscripts

Spacing around subscripts within strings seems to work well:

But the spacing around sub-subscripts does not:

I did not manually add that space after the 2. How can this be fixed? Thanks!

## 2 Answers

The subscript is interpreted as Times[Subscript[H, 2], O], and Mathematica uses spaces to denote multiplication. You can work around this by using the ZeroWidthTimes option:

• I appreciate this workaround. Unfortunately, this is one example of several where strings are getting parsed when I don't want them to. I learned (from you) that I could stop different coloration by using ShowAutoStyles->False. Here I learn that I can fix misdisplayed strings with ZeroWidthTimes->True. This is feeling like whack-a-mole. I keep finding places where my notation (Chemistry-specific) runs counter to Mathematica assumptions, and so I have to tell Mathematica to handle each differently, when what I would really like is to tell Mathematica to simply not parse strings. Period. – Kevin Ausman Apr 12 '19 at 21:48
• @KevinAusman The problem is that using subscripts inside of a string creates linear syntax, which is essentially the boxes of an expression. It is not a simple string. – Carl Woll Apr 12 '19 at 21:56
• Fair enough. I guess I just don't see why a RowBox assumes that sequential boxes are multiplications. It makes sense to assume that if we have an expression, but not if it's in a string. – Kevin Ausman Apr 12 '19 at 22:17

I don't know if this will suit your situation but if you just want to get the expression typeset correctly in, say, a label for graphics, you can do this;

Subscript[X, Row[{Subscript[H, 2], O}]]