Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » writing documentation » handling hypertext » texMath
next | previous | forward | backward | up | index | toc

# texMath -- convert to TeX math format

- Usage:
    `texMath x`
- Inputs:
  - x, any Macaulay2 object
- Outputs:
  - a string, x converted to TeX math format

## Description

The main difference between this and tex is that the surrounding dollar signs aren't there.

    i1 : R = ZZ[x];

    i2 : texMath (x-1)^6

    o2 = x^{6}-6\,x^{5}+15\,x^{4}-20\,x^{3}+15\,x^{2}-6\,x+1

## Caveat

No attempt is made to wrap large matrices or equations.

## See also

- tex -- convert to $\TeX$ format
- mathML -- convert to MathML format
- showTex -- display various objects in an external viewer

## For the programmer

The object texMath is a method function with a single argument.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/texMath-doc.m2:28:0.