# Mathematica Mathematica TexForm

#### Orion1

Mathematica has a command that converts notebook (.nb) format into TeX (.tex) format:

$$\text{In[1]:=} \frac{{\left( x + y \right) }^2}{{\sqrt{x\,y}}}$$
$$\text{Out[1]:=} \frac{{\left( x + y \right) }^2}{{\sqrt{x\,y}}}$$
$$\text{In[2]:= TeXForm[ \% ]}$$
$$\text{Out[2] TeXForm=}$$ \frac{{\left( x + y \right) }^2}{{\sqrt{x\,y}}}

I noticed that alot of calculus students have problems with interfacing these two forms and generally manually input equations into both programs independently. Also noticed problems with students on a Mathematica platform publishing their equations on this forum in TeX (.tex) format for peer review, however these instruction commands allow for usage for both applications.

Physicsforums TeX interface:
Code:
$$\frac{{\left( x + y \right) }^2}{{\sqrt{x\,y}}}$$

Mathematica 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.

Code:
TeXForm[ expr ] - print expr in TeX input form

$$\text{In[3]:= TeXForm} [ \frac{{\left( x + y \right) }^2}{{\sqrt{x\,y}}}]$$
$$\text{Out[3] TeXForm=}$$ \frac{{\left( x + y \right) }^2}{{\sqrt{x\,y}}}

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.
Code:
TeXSave [" file .tex"] - save your complete notebook in current TeX input form.
TeXSave [" file .tex", "source.nb"] - save a TeX version of the notebook source (.nb)
Reference:
http://documents.wolfram.com/v5/TheMathematicaBook/APracticalIntroductionToMathematica/FilesAndExternalOperations/1.11.6.html" [Broken]
http://documents.wolfram.com/v5/TheMathematicaBook/APracticalIntroductionToMathematica/FilesAndExternalOperations/NBMLImages/1.11.6/1.11.6_3.gif" [Broken]
http://documents.wolfram.com/v5/TheMathematicaBook/APracticalIntroductionToMathematica/FilesAndExternalOperations/NBMLImages/1.11.6/1.11.6_9.gif" [Broken]

Last edited by a moderator:
Related Math Software Workshop News on Phys.org

"Mathematica TexForm "

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving