TeXForm[expr]
prints as a
version of expr.
TeXForm
TeXForm[expr]
prints as a
version of expr.
Details
- TeXForm produces AMS-La
‐compatible
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
output. » - Symbols with names like alpha and ALPHA that correspond to
symbols are translated into their corresponding
symbols. » - Following standard mathematical conventions, single‐character 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
equivalents.
Examples
open all close allBasic Examples (1)
Scope (9)
TeXForm /@ {Subscript[x, a], x^a, Subsuperscript[x, a, b]}TeXForm /@ {Subscript[x, 2k + 1], x^2k + 1}TeXForm /@ {Overscript[x, a], Underscript[x, a]}TeXForm[{a, b, c}]TeXForm[{{a, b}, {c}}]TeXForm[{{a, b, c}, {d, e, f}}]TeXForm[Expand[(x + y) ^ 3]]TeXForm[LogicalExpand[Xor[x, y]]]TeXForm[ForAll[x, a∈Reals, x ^ 2 + a x + 1 > 0]]TeXForm[Integrate[f[x], x]]TeXForm[Sum[f[n], {n, 1, m}]]TeXForm[Limit[f[x], x -> ∞]]TeXForm /@ {Sqrt[x], x ^ (1 / 3), Sin[x], ArcSin[x]}TeXForm /@ {Zeta[s], Erf[x], HypergeometricPFQ[{Subscript[a, 1], Subscript[a, 2]}, {Subscript[b, 1]}, x]}TeXForm /@ {gamma, GAMMA, Pi, E, I}Generalizations & Extensions (1)
TeXForm gives the
representation of the TraditionalForm expression:
TeXForm[Sin[x]]TeXForm[TraditionalForm[Sin[x]]]Obtain the
representation of the expression in StandardForm:
TeXForm[StandardForm[Sin[x]]]Properties & Relations (5)
t = TeXForm[1.2 x + Exp[y]]Use ToExpression to convert
back to Wolfram Language syntax:
ToExpression[ToString[t], TeXForm]Use ToExpression to convert from
to the Wolfram Language:
ToExpression["$\\sin^{-1}(x)$", TeXForm]The following expression will evaluate:
Sum[n ^ 2, {n, 1, m}]TeXForm[Sum[n ^ 2, {n, 1, m}]]Use HoldForm to convert unevaluated expressions:
TeXForm[HoldForm[Sum[n ^ 2, {n, 1, m}]]]Add formatting via Format:
bin[x, y]//TeXFormFormat[bin[x_, y_], TeXForm] := MatrixForm[{{x}, {y}}]bin[x, y]//TeXFormUse Export to generate a compilable
document:
ExportString[TraditionalForm[Sin[x]], "TeX"]When an input evaluates to TeXForm[expr], TeXForm does not appear in the output:
TeXForm[x ^ 2]Out is assigned the value x2, not TeXForm[x^2]:
%Possible Issues (1)
Even when an output omits TeXForm from the top level, it is not stripped from subexpressions:
e = TeXForm[x ^ 2]The output does not have TeXForm in it:
%However, the variable e does have TeXForm in it, which may affect subsequent evaluations:
FullForm[e]The product is not evaluated due to the intervening TeXForm:
x * eAssign variables first and then apply TeXForm to the result to maintain computability:
(f = x ^ 2)//TeXFormx * fSee Also
Export StandardForm TraditionalForm MathMLForm
Function Repository: LaTeXPreview MaTeXInstall
Tech Notes
Related Guides
Related Workflows
- Generate TeX with the Wolfram Language
History
Introduced in 1988 (1.0) | Updated in 1996 (3.0) ▪ 2003 (5.0) ▪ 2004 (5.1)
Text
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.
APA
Wolfram Language. (1988). TeXForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TeXForm.html
BibTeX
@misc{reference.wolfram_2026_texform, author="Wolfram Research", title="{TeXForm}", year="2004", howpublished="\url{https://reference.wolfram.com/language/ref/TeXForm.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_texform, organization={Wolfram Research}, title={TeXForm}, year={2004}, url={https://reference.wolfram.com/language/ref/TeXForm.html}, note=[Accessed: 13-June-2026]}