WOLFRAM

TeXForm[expr]

prints as a TeX version of expr.

Details

  • TeXForm produces AMS-LaTeXcompatible TeX output.
  • When an input evaluates to TeXForm[expr], TeXForm does not appear in the output. »
  • TeXForm translates standard mathematical functions and operations.
  • TeXForm[expr] is equivalent to TeXForm[TraditionalForm[expr]]. TeXForm[StandardForm[expr]] can be used to get StandardForm TeX output. »
  • Symbols with names like alpha and ALPHA that correspond to TeX symbols are translated into their corresponding TeX symbols. »
  • Following standard mathematical conventions, singlecharacter symbol names are given in italic font, while multiple character names are given in roman font.
  • Wolfram Language special characters are translated whenever possible to their TeX equivalents.

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

A polynomial:

A typeset expression:

A special character:

Scope  (9)Survey of the scope of standard use cases

Subscripts and superscripts:

Out[1]=1
Out[2]=2

Overscripts and underscripts:

Out[1]=1

List structures:

A matrix:

Algebra and logic operations:

Calculus operations:

Elementary functions:

Out[1]=1

Special functions:

Out[1]=1

Named symbols are translated:

Out[1]=1

Generalizations & Extensions  (1)Generalized and extended use cases

TeXForm gives the TeX representation of the TraditionalForm expression:

Obtain the TeX representation of the expression in StandardForm:

Properties & Relations  (5)Properties of the function, and connections to other functions

Convert an expression to TeX:

Use ToExpression to convert TeX back to Wolfram Language syntax:

Out[2]=2

Use ToExpression to convert from TeX to the Wolfram Language:

Out[3]=3

The following expression will evaluate:

Out[1]=1

Use HoldForm to convert unevaluated expressions:

Add formatting via Format:

Use Export to generate a compilable TeX document:

Out[1]=1

When an input evaluates to TeXForm[expr], TeXForm does not appear in the output:

Out is assigned the value x2, not TeXForm[x^2]:

Out[2]=2

Possible Issues  (1)Common pitfalls and unexpected behavior

Even when an output omits TeXForm from the top level, it is not stripped from subexpressions:

The output does not have TeXForm in it:

Out[2]=2

However, the variable e does have TeXForm in it, which may affect subsequent evaluations:

The product is not evaluated due to the intervening TeXForm:

Out[4]=4

Assign variables first and then apply TeXForm to the result to maintain computability:

Out[6]=6

Neat Examples  (1)Surprising or curious use cases

A continued fraction:

Out[1]=1
Wolfram Research (1988), TeXForm, Wolfram Language function, https://reference.wolfram.com/language/ref/TeXForm.html (updated 2004).
Wolfram Research (1988), TeXForm, Wolfram Language function, https://reference.wolfram.com/language/ref/TeXForm.html (updated 2004).

Text

Wolfram Research (1988), TeXForm, Wolfram Language function, https://reference.wolfram.com/language/ref/TeXForm.html (updated 2004).

Wolfram Research (1988), TeXForm, Wolfram Language function, https://reference.wolfram.com/language/ref/TeXForm.html (updated 2004).

CMS

Wolfram Language. 1988. "TeXForm." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2004. https://reference.wolfram.com/language/ref/TeXForm.html.

Wolfram Language. 1988. "TeXForm." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2004. https://reference.wolfram.com/language/ref/TeXForm.html.

APA

Wolfram Language. (1988). TeXForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TeXForm.html

Wolfram Language. (1988). TeXForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TeXForm.html

BibTeX

@misc{reference.wolfram_2025_texform, author="Wolfram Research", title="{TeXForm}", year="2004", howpublished="\url{https://reference.wolfram.com/language/ref/TeXForm.html}", note=[Accessed: 20-July-2025 ]}

@misc{reference.wolfram_2025_texform, author="Wolfram Research", title="{TeXForm}", year="2004", howpublished="\url{https://reference.wolfram.com/language/ref/TeXForm.html}", note=[Accessed: 20-July-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_texform, organization={Wolfram Research}, title={TeXForm}, year={2004}, url={https://reference.wolfram.com/language/ref/TeXForm.html}, note=[Accessed: 20-July-2025 ]}

@online{reference.wolfram_2025_texform, organization={Wolfram Research}, title={TeXForm}, year={2004}, url={https://reference.wolfram.com/language/ref/TeXForm.html}, note=[Accessed: 20-July-2025 ]}