1.11.6 Generating and Importing TeXMathematica notebooks provide a sophisticated environment for creating technical documents. But particularly if you want to merge your work with existing material in TeX, you may find it convenient to use TeXForm to convert expressions in Mathematica into a form suitable for input to TeX.
| TeXForm[expr] | print expr in TeX input form |
Mathematica output for TeX. | Here is an expression, printed in standard Mathematica form. | |
In[1]:=
(x + y)^2 / Sqrt[x y]
|
Out[1]=
|
|
| Here is the expression in TeX input form. | |
Out[2]//TeXForm=
|
|
| ToExpression["input", TeXForm] | convert TeX input to Mathematica |
Converting TeX strings to Mathematica. | This converts a TeX string to Mathematica. Note the double backslashes needed in the string. | |
In[3]:=
ToExpression["\\sqrt{x y}", TeXForm]
|
Out[3]=
|
|
In addition to being able to convert individual expressions to TeX, Mathematica also provides capabilities for translating complete notebooks. These capabilities can usually be accessed from the Save As Special menu in the notebook front end, where various options can be set.
|