Eqn is a preprocessor designed to facilitate the typesetting of mathematical equations. Use neqn with nroff. Eqn has the following command-line syntax:
/usr/ucb/eqn
[options
] [files
]
xy
Use x
and y
as start and stop delimiters;
same as specifying the eqn directive delim
xy
.
n
Change to font n
; same as the gfont
directive.
n
Reduce size of superscripts and subscripts by n
points.
If -p
is not specified, the default reduction is 3 points.
n
Reduce the point size by n
points; same as the gsize
directive.
dev
Format output to device dev
. The default value comes from
the TYPESETTER environment variable. Not available with neqn.
Start typesetting mathematics.
End typesetting mathematics.
Use the checkeq
command to check for unmatched macro pairs.
The character sequences below are recognized and translated as shown:
Character | Translation | Character | Translation |
---|---|---|---|
>= | approx | ||
<= | nothing | ||
== | cdot | . | |
!= | times | × | |
+- | ± | del | |
-> | grad | ||
<- | ... | ... | |
<< | ,..., | ,..., | |
>> | sum | ||
inf | int | ||
partial | prod | ||
half | ½ | union | |
prime | inter |
Digits, parentheses, brackets, punctuation marks, and the following mathematical words are printed out in Roman font:
sin cos tan arc sinh cosh tanh and if for det max min lim log ln exp Re Im
Greek letters can be printed in uppercase or lowercase. To obtain Greek letters, simply spell them out. Some uppercase Greek letters are not supported because they can be specified by an Arabic equivalent (e.g, A for alpha, B for beta).
Character | Translation | Character | Translation |
---|---|---|---|
alpha | tau | ||
beta | upsilon | ||
gamma | phi | ||
delta | chi | ||
epsilon | psi | ||
zeta | omega | ||
eta | GAMMA | ||
theta | DELTA | ||
iota | THETA | ||
kappa | LAMBDA | ||
lambda | XI | ||
mu | PI | ||
nu | SIGMA | ||
xi | UPSILON | ||
omicron | PHI | ||
pi | PSI | ||
rho | OMEGA | ||
sigma |
Several keywords are available to mark the tops of characters.
Eqn centers a mark at the correct height.
bar
and under
will span the necessary length.
Character | Translation |
---|---|
x dot | |
x dotdot | |
x hat | |
x tilde | |
x vec | |
x dyad | |
x bar | |
x under |
In addition to character names and diacritical marks, eqn recognizes the following keywords:
Separate the pieces of a pile or matrix column.
n
Move backwards horizontally n
1/100's of an m.
Change to bold font.
Center align a column of a matrix.
Make a centered pile (same as pile).
Create a name for a frequently used string.
xy
Define two characters to mark the left and right ends of an eqn
equation to be printed in line. Use delim off
to turn of
delimiters.
n
Move down n
1/100's of an m.
Widen the current font by overstriking it.
x
Change to font x
, where x
is the one-character name or
the number of a font.
Used in summations, integrals, and similar constructions to signify the lower limit.
n
Move forward horizontally n
1/100's of an em.
x
Set a global font x
for all equations.
n
Set a global size for all equations.
Change to italic font.
Left justify a column of a matrix.
Create big brackets, big braces, big bars, etc.
Line up marks in equations on different lines.
Left justify the elements of a pile.
Remember the horizontal position in an equation. Used with lineup.
Create a matrix.
Create a definition which takes effect only when neqn is running.
Make a fraction.
Make a vertical pile with elements centered above one another.
Right adjust a column of a matrix.
Create big brackets, big braces, big bars, etc.
Change to roman font.
Right justify the elements of a pile.
n
Change the size of the font to n
.
Draw a square root sign.
Start a subscript.
Start a superscript.
Make a definition which will apply only for eqn.
Used in summations, integrals, and similar constructions to signify the upper limit.
n
Move up n
1/100's of an em.
Force extra space into the output.
Force a space one half the size of the space forced by ~ .
Force eqn to treat an element as a unit.
A string within quotes is not subject to alterations by eqn.
If you don't use braces, eqn will do operations in the order shown in this list, reading from left to right.
dyad | vec | under | bar |
tilde | hat | dot | dotdot |
fwd | back | down | up |
fat | roman | italic | bold |
size | sub | sup | sqrt |
over | from | to |
These operations group to the left:
over sqrt left right
All others group to the right.
Input:
.EQ delim %% .EN %sum from i=0 to inf c sup i~=~lim from {m -> inf} sum from i=0 to m c sup i% .EQ delim off .EN
Result:
Input:
.EQ delim %% .EN %x ~=~ left [ { -b ~+-~ sqrt {b sup 2 - ~4ac} } over 2a right ]% .EQ delim off .EN