neqn(1)
NAME
neqn − format mathematical text for nroff
SYNOPSIS
neqn [-d xy] [-s n] [-f n] [-p n] [file ...]
DESCRIPTION
neqn is a preprocessor for nroff for typesetting mathematical text on typewriter-like terminals. nroff(1) Usage is almost always of the following two forms or equivalent:
neqn files |nroff|col
tbl files |neqn|nroff|
If no files are specified (or if - is specified as the last argument), neqn reads from the standard input. A line beginning with .EQ marks the start of an equation. The end of an equation is marked by a line beginning with .EN. Neither of these lines is altered, which means that they can be defined in macro packages to get centering, numbering, etc. It is also possible to designate two characters as delimiters; subsequent text between delimiters is then treated as neqn input. Delimiters can be set to characters x and y with the command-line argument -dxy or (more commonly) with delim xy between .EQ and .EN. The left and right delimiters can be the same character; the dollar sign is often used as such a delimiter. Delimiters are turned off by delim off (see WARNINGS below). All text that is neither between delimiters nor between .EQ and .EN is passed through untouched.
Tokens within neqn are separated by spaces, tabs, new-lines, braces, double quotes, tildes, and circumflexes. Braces {} are used for grouping; generally speaking, anywhere a single character such as x could appear, a complicated construction enclosed in braces can be used instead. Tilde (~) represents a full space in the output, circumflex (^) half as much.
Subscripts and Superscripts
Subscripts and superscripts are produced using sub and sup as follows:
Source Text Result
x sub j xj
a sub k sup 2 ak2
e sup {x sup 2 + y sup 2} ex2+y2
Fractions
Fractions are produced by using over :
Source Text Result
a over b a over b
Square Roots
sqrt produces square roots:
Source Text Result
1 over sqrt {ax sup 2+bx+c} 1 over √ax2+bx+c
Upper and Lower Limits
The keywords from and to specify lower and upper limits:
Source Text Result
lim from {n -> inf } sum from 0 to n x sub i limn→∞ n∑0 xi
Brackets and Braces
Left and right brackets, braces, and such, of proper height are made with left and right:
Source Text Result
left [ {x sup 2 + y sup 2} over alpha right ] ~=~ 1
⎡
⎢
⎣x2+y2 over α
⎤
⎥
⎦ = 1
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). A left thing need not have a matching right thing.
Vertical Piles
Vertical piles of things are made with pile, lpile, cpile, and rpile:
Source Text Result
pile {a above b above c} a
b
c
Piles can have arbitrary numbers of elements; lpile left justifies, pile and cpile center (but with different vertical spacing), and rpile right justifies.
Matrices and Determinants
Matrices are made with matrix:
Source Text Result
left | { matrix { lcol { x sub i above y sub 2 } ccol { 1 above 2 } } } right |
| xi
y21
2 |
In addition, there is rcol for a right-justified column.
Diacritical Marks
Diacritical marks are made with dot, dotdot, hat, tilde, bar, vec, dyad, and under:
Source Text Result
x dot = f(t) bar ẋ=f(t)
y dotdot bar ~=~ n under ÿ = n
x vec ~=~ y dyad x⃗ = y⃡
Point sizes and fonts can be changed with size n or size ±n, roman, italic, bold, and font n. Point sizes and fonts can be changed globally in a document by gsize n and gfont n, or by the command-line arguments -sn and -fn.
Normally, subscripts and superscripts are reduced by 3 points 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 lineup point in the first equation; place lineup at the place that is to line up vertically in subsequent equations.
Shorthand Forms
Shorthand forms can be defined or existing keywords redefined with define:
define thing % replacement %
defines a new token called thing that is replaced by replacement whenever it appears thereafter. The % can be any character that does not occur in replacement.
Keywords such as sum (∑),int (∫),inf (∞),and shorthands such as >= (≥),!= (≠),and -> (→)are recognized. Greek letters are spelled out in uppercase or lowercase as desired, as in alpha (α)or GAMMA (Γ).Mathematical words such as sin, cos, and log are made Roman automatically. nroff four-character escapes such as \(dd (‡) and \(bu (•) can be used anywhere. Strings enclosed in double quotes ("...") are passed through untouched; this permits keywords to be entered as text, and can be used to communicate with nroff when other methods fail. Details are given in the manuals cited below.
EXTERNAL INFLUENCES
Environment Variables
LC_CTYPE determines the interpretation of text as single- and/or multi-byte characters.
LANG determines the language in which messages are displayed.
If LC_CTYPE is not specified in the environment or is set to the empty string, the value of LANG is used as a default for each unspecified or empty variable. If LANG is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG. If any internationalization variable contains an invalid setting, neqn behaves as if all internationalization variables are set to "C". See environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
WARNINGS
To embolden digits, parentheses, etc., it is necessary to quote them, as in bold "12.3".
Also see WARNINGS under nroff(1).
Good practice dictates that if a delimiter is specified in a file, the delim off directive should be included at the end of the file to prevent undesirable behavior when processing multiple files where a subsequent file may contain the delimiter character as part of regular text.
To properly display equations on terminal screens and other devices that do not support reverse line feeds, nroff output should be piped through col(1).
SEE ALSO
mm(1), nroff(1), tbl(1), mm(5).
Typesetting Mathematics−User’s Guide, by B. W. Kernighan and L. L. Cherry.
New Graphic Symbols for EQN and NEQN, by C. Scrocca.
Hewlett-Packard Company — HP-UX Release 9.0: August 1992