此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.2)
Import/Export 导入/导出 格式

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.
  • Export["file.tex", expr] exports arbitrary expressions, Notebook or Cell objects, as well as any box expressions obtained from ToBoxes to the TeX format.
  • The exported TeX includes markup material which 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.
  • 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.
"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 "DocumentClass" include "article", "report" and "letter".
  • Possible values for "MathOutput" are:
"EPS"converts typeset expressions to EPS, stored in separate files
"TeX"formats all typeset expressions to embedded TeX macros
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 "ConversionRules" for the translation of a Mathematica style element to a user-defined TeX macro:
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 "BoxRules" option to customize how Mathematica boxes are translated to TeX:
In[1]:=
Click for copyable input
Out[1]=