# How to fix the spacing problem using TeXForm for styling plots

Reference my old questions, How to use LaTeX for typesetting labels and titles in Mathematica and LaTeX and Mathematica.

The problem is simple to explain. When I do this

p = Plot[0, {x, 0, 2},
Epilog -> Text[
Style[ToExpression["\\sin(x\\,y)", TeXForm, HoldForm], Large], {1, .5}]
]


The spacing between x and y is too large. Is there a way to reduce it?

I am using version 10.0.2 on Windows.

• I normally use an invisible space for typesetting things such as (x y). Can't help you with the second part. LaTeX fonts always look different to everything else IMO – Mike Honeychurch Feb 7 '15 at 5:34
• @MikeHoneychurch adding invisible space does not work for TeXForm, it still appears as one letter xy. Screen shot: !Mathematica graphics which is the issue mentioned above by Jens about the spacing. – Nasser Feb 7 '15 at 5:51
• Does the option ZeroWidthTimes->True help with the first issue? I.e., Text[Style[ToExpression["\\sin(x\\,y)", TeXForm, HoldForm], Large, ZeroWidthTimes -> True], {1, .5}] – kglr Feb 7 '15 at 6:11
• @kguler that is a nice trick. Yes, it helped a lot. Now the spacing is OK and can live with it. I'll update my question with your suggestion so it is all in one place. I guess now only the font issue is left. I am looking to see if there is a font setting to use. – Nasser Feb 7 '15 at 6:28
• @kguler fyi, I updated the question to only for the font issue. Thanks to your hint, the spacing issue is no longer a problem. – Nasser Feb 7 '15 at 6:40

Using the option ZeroWidthTimes->True in Style solves the spacing problem:
expr = Style[ToExpression["\\sin(x\\,y)", TeXForm, HoldForm], Large, ZeroWidthTimes -> True];