Recently I need to convert a lot of expressions containing dot products into Latex code. To my annoyance, the mathematica system will always leave literal dots (".") in the latex code, but in reality the dot is mostly omitted in Latex code.
For example, I need to convert this matrix into its latex code:
MatrixForm[{{Transpose[X] . X, Transpose[X] . Subscript[x, 0]}, {Transpose[Subscript[x, 0]] . X, Transpose[Subscript[x, 0]] . Subscript[x, 0]}}]
(Sorry I have to add a picture of the code since the web site keeps notifying me that "Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button or the CTRL+K keyboard shortcut. For more editing help, click the [?] toolbar icon. " and prevented me from posting if I contain the original code. I have tried to follow the instructions but nothing has done the trick.)
What I get from directly converting it into Latex code:
But generally, the dot "." generated from dot product is not needed in Latex, what I want is:
Then, how can I tell Mathematica not to generate the dot "." when convert a dot product into its Latex code?
ToString[expr, TeXForm]
orTeXForm[expr]
or something else? $\endgroup$