# 00025

### Equations: Typesetting mathematical equations

What support is there for including equations in Web pages?

Mediæval writing desk

The Wikipublisher library includes a recipe based on the LatexRender php class library, which allows authors to display equations on the Web and in print. Equation (1) illustrates the capabilities and shows the equation is numbered automatically.

(1)

The recipe uses LATEX and ImageMagick to generate a gif image of the equation for Web display. This approach guarantees that the Web and print versions are the same. To insert an equation, wrap TEX equation markup in the {$...$} tags.

By default, equations are unnumbered. The above example uses the {$uniqueID, ...$} markup variant, which assigns a label and number. Authors can refer to a labelled equation using the EQ(uniqueID) cross-reference markup (like the FIG, TAB and DIV cross-reference markup). The Eq(uniqueID) variant capitalises the first letter. The following equation is unnumbered with colour:

Authors can also write multi-line equations, e.g. equation (2):

(2)

The above markup techniques are suitable for inline equations or ones that “stand alone”. However, we often want to put several equations together, aligned on the = sign or other relational symbol. If 2 or more consecutive lines start and end with {$...$} markup, this is interpreted as a set of aligned equations. In the following example, the first equation line starts with {\$*; the * suppresses the numbering that LATEX will otherwise generate for this environment.

Discussion of TEX equation markup is beyond the scope of this tip. There are more examples at LATEX Equations and Aligned Equations.

Interested readers may wish to view the source of the current page.

Category: markup