home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeBook TitleSearch this book

17.2. eqn

eqn is a preprocessor designed to facilitate the typesetting of mathematical equations. Use neqn with nroff. eqn has the following command-line syntax:

eqn [options] [files]

The canonical reference for eqn is Typesetting Mathematics--User's Guide, by L.L. Cherry and B.W. Kernighan, in UNIX Programmer's Manual, Tenth Edition, Volume 2, AT&T Bell Laboratories, M.D. McIlroy and A.G. Hume editors, Holt Rinehart & Winston, 1990. This paper may be downloaded from http://cm.bell-labs.com/cm/cs/doc/74/eqn.ps.gz.

17.2.1. Options

-dxy
Use x and y as start and stop delimiters; same as specifying the eqn directive delim xy.

-fn
Change to font n; same as the gfont directive.

-pn
Reduce size of superscripts and subscripts by n points. If -p is not specified, the default reduction is 3 points.

-sn
Reduce the point size by n points; same as the gsize directive.

-Tdev
Format output to device dev. The default value comes from the TYPESETTER environment variable. Not available with neqn. (This option is not on Solaris eqn.)

17.2.4. Mathematical Text

Digits, parentheses, brackets, punctuation marks, and the following mathematical words are printed out in roman font:

sincostanarc
sinhcoshtanh 
andiffordet
maxminlim 
loglnexp 
ReIm 

17.2.7. Keywords Recognized by eqn

In addition to character names and diacritical marks, eqn recognizes the following keywords.

above

Separate the pieces of a pile or matrix column.

back n

Move backwards horizontally n 1/100s of an em.

bold

Change to bold font.

ccol

Center-align a column of a matrix.

cpile

Make a centered pile (same as pile).

define

Create a name for a frequently used string.

delim xy

Define two characters to mark the left and right ends of an eqn equation to be printed inline. Use delim off to turn off delimiters.

down n

Move down n 1/100s of an em.

fat

Widen the current font by overstriking it.

font x

Change to font x, where x is the name or number of a font.

from

Used in summations, integrals, and similar constructions to signify the lower limit.

fwd n

Move forward horizontally n 1/100s of an em.

gfont x

Set a global font x for all equations.

gsize n

Set a global size for all equations.

italic

Change to italic font.

lcol

Left-justify a column of a matrix.

left

Create big brackets, big braces, big bars, etc.

lineup

Line up marks in equations on different lines.

lpile

Left-justify the elements of a pile.

mark

Remember the horizontal position in an equation. Used with lineup.

matrix

Create a matrix.

ndefine

Create a definition that takes effect only when neqn is running.

over

Make a fraction.

pile

Make a vertical pile with elements centered above each other.

rcol

Right-adjust a column of a matrix.

right

Create big brackets, big braces, big bars, etc. Must have a matching left.

roman

Set following constant in roman.

rpile

Right-justify the elements of a pile.

size n

Change the size of the font to n.

sqrt

Take the square root of the following equation element.

sub

Start a subscript.

sup

Start a superscript.

tdefine

Make a definition that applies only to eqn.

to

Used in summations, integrals, and similar constructions to signify the upper limit.

up n

Move up n 1/100s 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.

17.2.8. Precedence

If you don't use braces, eqn performs operations in the order shown in this list, reading from left to right.

dyadvecunderbar
tildehatdotdotdot
fwdbackdownup
fatromanitalicbold
sizesubsupsqrt
overfromto 

These operations group to the left:

oversqrtleftright

All others group to the right.

eqn defines a language for writing mathematics. Thus, there is a grammar with rules about how to group and order items within the equation. See the Bell Labs memorandum for the full story.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.