Skip to main content
deleted 1 character in body
Source Link
Mr.Wizard
  • 275.2k
  • 34
  • 606
  • 1.5k

I am posting a second answer because I am now taking a very different interpretation of your problem. In a comment below my first answer you state:

Your function seems to correct one type problem with fraction. But I am more looking for something able to display TeX in the exact form I write them. Probably MM is not the right tool to use. I am disapointed.

I assumed that you were looking for TeX conversion of arbitrary expressions generated by (evaluation in) Mathematica but if instead you simply want TeX for expressionexpressions in "the exact form I write them" you may be able to use Strings, e.g.:

enter image description here

The string was created using standard input methods. \\[Times]\[Times] was entered with EscEsc*EscEsc. Here

Here is the input in copyable form:

"\!\(\*FractionBox[\(1\), \(2\)]\)\[Times]\!\(\*FractionBox[\(3\), \(4\)]\)" // TeXForm 

And the output formatted by MathJax:

$\frac{1}{2}\times \frac{3}{4}$

Critically this method avoids interpretation of your raw input into e.g. Times and Power, thereby bypassing those "pretty printing" rules that were changing your expression in an unwanted way.

I am posting a second answer because I am now taking a very different interpretation of your problem. In a comment below my first answer you state:

Your function seems to correct one type problem with fraction. But I am more looking for something able to display TeX in the exact form I write them. Probably MM is not the right tool to use. I am disapointed.

I assumed that you were looking for TeX conversion of arbitrary expressions generated by (evaluation in) Mathematica but if instead you simply want TeX for expression in "the exact form I write them" you may be able to use Strings, e.g.:

enter image description here

The string was created using standard input methods. \\[Times] was entered with Esc*Esc. Here is the input in copyable form:

"\!\(\*FractionBox[\(1\), \(2\)]\)\[Times]\!\(\*FractionBox[\(3\), \(4\)]\)" // TeXForm 

And the output formatted by MathJax:

$\frac{1}{2}\times \frac{3}{4}$

Critically this method avoids interpretation of your raw input into e.g. Times and Power, thereby bypassing those "pretty printing" rules that were changing your expression in an unwanted way.

I am posting a second answer because I am now taking a very different interpretation of your problem. In a comment below my first answer you state:

Your function seems to correct one type problem with fraction. But I am more looking for something able to display TeX in the exact form I write them. Probably MM is not the right tool to use. I am disapointed.

I assumed that you were looking for TeX conversion of arbitrary expressions generated by (evaluation in) Mathematica but if instead you simply want TeX for expressions in "the exact form I write them" you may be able to use Strings, e.g.:

enter image description here

The string was created using standard input methods. \[Times] was entered with Esc*Esc.

Here is the input in copyable form:

"\!\(\*FractionBox[\(1\), \(2\)]\)\[Times]\!\(\*FractionBox[\(3\), \(4\)]\)" // TeXForm 

And the output formatted by MathJax:

$\frac{1}{2}\times \frac{3}{4}$

Critically this method avoids interpretation of your raw input into e.g. Times and Power, thereby bypassing those "pretty printing" rules that were changing your expression in an unwanted way.

Source Link
Mr.Wizard
  • 275.2k
  • 34
  • 606
  • 1.5k

I am posting a second answer because I am now taking a very different interpretation of your problem. In a comment below my first answer you state:

Your function seems to correct one type problem with fraction. But I am more looking for something able to display TeX in the exact form I write them. Probably MM is not the right tool to use. I am disapointed.

I assumed that you were looking for TeX conversion of arbitrary expressions generated by (evaluation in) Mathematica but if instead you simply want TeX for expression in "the exact form I write them" you may be able to use Strings, e.g.:

enter image description here

The string was created using standard input methods. \\[Times] was entered with Esc*Esc. Here is the input in copyable form:

"\!\(\*FractionBox[\(1\), \(2\)]\)\[Times]\!\(\*FractionBox[\(3\), \(4\)]\)" // TeXForm 

And the output formatted by MathJax:

$\frac{1}{2}\times \frac{3}{4}$

Critically this method avoids interpretation of your raw input into e.g. Times and Power, thereby bypassing those "pretty printing" rules that were changing your expression in an unwanted way.