TeX (.tex)

MIME type: application/x-tex
TeX typesetting system and programming language.
Commonly used for typesetting mathematical and scientific publications and other technical documents.
Plain text format.
Describes the contents and the layout of multi-page documents.
Developed since 1977 by Donald Knuth.
  • Export creates files compatible with AMS-LaTeX.
  • See the "LaTeX" reference page for complete information about importing TeX documents.

Import and ExportImport and Export

  • Export["file.tex", expr] exports arbitrary expressions and Notebook or Cell objects, as well as any box expressions obtained from ToBoxes, to the TeX format.
  • The exported TeX includes markup material that maintains much of the document structure that exists within Mathematica.
  • Export always generates complete AMS-LaTeX documents, not merely TeX language fragments.
  • TeXForm can be used to create a TeX version of a typeset expression.
  • Export["file.tex", expr, elem] creates a TeX file by treating expr as specifying element elem.
  • The export format can be explicitly specified with the command Export["file", expr, "TeX"].
  • See the reference pages for full general information on Export.
  • ExportString supports the TeX format.

Notebook InterfaceNotebook Interface

  • In the notebook front end, Save As exports the active notebook as a TeX file.
  • Save Selection As exports the selected part of a notebook to TeX.

OptionsOptions

  • Advanced Export options:
  • "BoxRules"{}specifies mappings from Mathematica box expressions to TeX elements
    "ConversionRules"Automaticspecifies mappings from Mathematica cell styles to TeX elements
    "DocumentClass""article"what LaTeX document type to use
    "MathOutput""TeX"format to use for typeset expressions
    "UsePackages"Automaticlist of packages to include in \usepackage{}
  • Typical settings for include "article", "report", and "letter".
  • Possible values for are:
  • "EPS"converts typeset expressions to EPS, stored in separate files
    "TeX"formats all typeset expressions to embedded TeX macros

ExamplesExamplesopen allclose all

Basic Examples (6)Basic Examples (6)

Export an arbitrary expression to TeX:

In[1]:=
Click for copyable input
Out[1]=

This converts a Cell expression to TeX:

In[1]:=
Click for copyable input
Out[1]=

Specify for the translation of a Mathematica style element to a user-defined TeX macro:

In[1]:=
Click for copyable input
Out[1]=

Create a numbered equation using the option:

In[1]:=
Click for copyable input
Out[1]=

Convert typeset expressions to EPS, stored in separate files:

In[1]:=
Click for copyable input
Out[1]=

Use the option to customize how Mathematica boxes are translated to TeX:

In[1]:=
Click for copyable input
Out[1]=
New in 5.1 | Last modified in 8
New to Mathematica? Find your learning path »
Have a question? Ask support »