
Typesetting Equations with eqn
Typesetting mathematical equations has always been a problem for users who have a limited knowledge of mathematics or typesetting. This is because mathematical expressions are often a mixture of standard text and special characters in different point sizes. For example, the equation:
![]()
requires three special charactrs (Σ, ∞, and →)and roman and italic characters in two different sizes. Expressions also may require horizontal and vertical printing motions (as in subscripts and superscripts).
You could code this example using troff requests, but the syntax for describing the printing motions, sizes, and fonts are difficult to learn and difficult to type in correctly. UNIX has formatting tools specifically designed for documents containing mathematical symbols—the programs eqn and neqn. The eqn program is a preprocessor for troff; neqn is a preprocessor for nroff.
With eqn you can typeset both inline equations and equations that are set off from the body of the text like the example shown. It takes an English-like description of a mathematical equation and generates a troff script. You don’t need to understand what you are typing.
The eqn preprocessor was designed to be easy to learn and even easier to use. This implies that normal mathematical conventions ...