`tex-math-preview`

helps you preview TeX math expressions.

The following forms are recognised at point

`$...$`

– for TeX`\(...\)`

and`\[...\]`

– for LaTeX`@math{...}`

– for Texinfo`<math>...</math>`

– for WikipediaMode markup`<alt role="tex">...</alt>`

– for DBTexMath?

The idea is to have point in the middle of such an expression and use `M-x tex-math-preview`

to look at how it comes out. `tex-mode`

(see TeX) has its own region previewing, and PreviewLaTeX has some fancy preview overlays, but `tex-math-preview`

is meant to be minimal. It just shows an image or an error.

Previewing is done either with `tex-dvi-view-command`

the same as `tex-mode`

, or if you have the `dvipng`

program then simply as an image in an Emacs buffer. The default is the latter if the display allows it, or you can customize the method with `tex-math-preview-function`

.

The code adds a `(thing-at-point 'tex-math)`

, see ThingAtPoint, which you can use from Lisp code if you want to do something else with the maths too.