EQN(1) BSD EQN(1)
NAME
eqn, neqn, checkeq - format mathematical text
SYNOPSIS
eqn [ -dxy ] [ -pn ] [ -sn ] [ -fn ] [ file ] ...
checkeq [ file ] ...
DESCRIPTION
eqn is a troff(1) preprocessor for typesetting mathematics on a
phototypesetter or laser printer. neqn is used to format mathematical
text on terminals. Usage is almost always as shown below:
eqn file ... | troff
neqn file ... | nroff
If you don't specify any files, eqn and neqn read from the standard
input. A line beginning with .EQ marks the start of an equation; a line
beginning with .EN marks the end of an equation Neither line is altered,
so you can define them in macro packages to get centering, numbering, and
so on. You can also set two characters as delimiters; subsequent text
between delimiters is treated as eqn input. The left and right
delimiters can be identical. Use delim off to turn off delimiters. All
text that is neither between delimiters nor between .EQ and .EN is passed
through untouched.
The checkeq program reports missing or unbalanced delimiters and .EQ/.EN
pairs.
Use spaces, tabs, newlines, braces, double quotes, tildes or circumflexes
to separate tokens within eqn. Use braces {} for grouping. Generally
speaking, anywhere a single character like x can appear, you can use a
complicated construction enclosed in braces instead. A tilde (~)
represents a full space in the output; a caret (^) half as much.
OPTIONS
-dxy Set delimiters to characters x and y. Delimiters are more
commonly set with delim xy between .EQ and .EN.
-pn Change the point size of subscripts and superscripts to the
value of n; normally they are reduced by three point sizes from
the previous size.
-sn Change the point size to the value of n.
-fn Change the font to the value of n.
LANGUAGE
This section explains the eqn language.
Subscripts and superscripts are produced with the keywords sub and sup.
Fractions are made with over: a over b yields a.
b
The sqrt keyword makes square roots.
The keywords from and to introduce lower and upper limits on arbitrary
things.
Left and right brackets, braces, and so on, of the right height are made
with left and right. left [ x + y over a right ] ~=~1 produces
|x+y| = 1
| a|
The right clause is optional. Legal characters after left and right are
braces, brackets, bars, c and f for ceiling and floor, and "" for nothing
at all (useful for a right-side-only bracket).
Vertical piles of things are made with pile, lpile, cpile, and rpile:
pile {a above b above c} produces
a
b
c
There can be an arbitrary number of elements in a pile. lpile left-
justifies, pile and cpile center, with different vertical spacing, and
rpile right justifies.
Use matrix to make matrices; matrix { lcol { x sub i above y sub 2 } ccol
{ 1 above 2 } } produces
xi 1
y2 2
In addition, you can use rcol for a right-justified column.
Diacritical marks are made with dot, dotdot, hat, tilde, bar, vec, dyad,
and under: x dot = f(t) bar produces
. ____
x=f(t)
..
y dotdot bar ~=~ n under produces y = n
You can change sizes and fonts with size n or size +n, roman, italic,
bold, and font n. You can change sizes and fonts globally in a document
using gsize n and gfont n, or by using the command-line arguments -sn and
-fn.
Normally, subscripts and superscripts are reduced by three point sizes
from the previous size; this can be changed by the command-line argument
-pn.
Successive display arguments can be lined up. Place mark before the
desired line-up point in the first equation; place lineup at the place
that is to line up vertically in subsequent equations.
Shorthands can be defined or existing keywords redefined with define;
for example, define thing % replacement % defines a new token called
thing that will be replaced by replacement whenever it appears
thereafter. The % can be any character that does not occur in
replacement.
Keywords like sum, int, inf, and shorthands like >= (>), -> (->), and !=
(≠) are recognized. Greek letters are spelled out in the desired case,
as in alpha or GAMMA. Mathematical words like sin, cos, and log, are made
roman automatically. You can use troff(1) four-character escapes like
\(dg (to produce the dagger character) anywhere. Strings enclosed in
double quotes "..." are passed through untouched; this allows you to
enter keywords as text, and you can use it to communicate with troff when
all else fails.
BUGS
To make digits, parentheses, and so on, appear in boldface, you must
quote them, as in bold "12.3".
SEE ALSO
troff(1), tbl(1), ms(7), me(7), eqnchar(7)
UNIX Text Processing
B. W. Kernighan and L. L. Cherry, Typesetting Mathematics-User's Guide
J. F. Ossanna, NROFF/TROFF User's Manual