neqn(1)neqn(1)NAMEneqn - format mathematical text for nroff
SYNOPSIS
xy] n] n] n] [file]...
Remarks
The output of is very device-dependent. See the section.
DESCRIPTION
is a preprocessor for (see nroff(1)) for typesetting mathematical text
on typewriter-like terminals. Its invocation is almost always one of
the following two forms or equivalent:
If no files are specified (or if is specified instead of file), reads
from standard input. A line beginning with marks the start of an equa‐
tion. The end of an equation is marked by a line beginning with Nei‐
ther of these lines is altered, which means that they can be defined in
macro packages to get centering, numbering, etc.
Delimiters
It is also possible to designate two characters as delimiters; subse‐
quent text between delimiters is then treated as input. Delimiters can
be set to characters x and y with the command-line argument or (more
commonly) with the sequence
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
(see the section). All text that is neither between delimiters nor
between and is passed through untouched. delim $$
Separators and Metacharacters
Tokens within equations are separated by spaces, tabs, newlines,
braces, double quotes, tildes, and circumflexes. Braces are used for
grouping; generally speaking, anywhere a single character such as x can
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 and as follows:
Source Text Result
────────────────────────────────────────────────────┬─────────────────────────────
│
x sub j │ $x sub j$
│
│
────────────────────────────────────────────────────┼─────────────────────────────
│
a sub k sup 2 │ $a sub k sup 2$
│
│
────────────────────────────────────────────────────┼─────────────────────────────
│
e sup {x sup 2 + y sup 2} │ $e sup {x sup 2 + y sup 2}$
│
│
────────────────────────────────────────────────────┴─────────────────────────────
Fractions
Fractions are produced by using
Source Text Result
────────────────────────────────────────────────────┬───────────────────
│
a over b │ $a over b$
│
│
────────────────────────────────────────────────────┴───────────────────
Square Roots
produces square roots:
Source Text Result
────────────────────────────────────────────────────┬───────────────────────────────
│
1 over sqrt {ax sup 2+bx+c} │ $1 over sqrt {ax sup 2+bx+c}$
│
│
────────────────────────────────────────────────────┴───────────────────────────────
Upper and Lower Limits
The keywords and specify lower and upper limits:
Source Text Result
────────────────────────────────────────────────────┬────────────────────────────────────────────────
│
lim from {n -> inf } sum from 0 to n x sub i │ $lim from {n -> inf } sum from 0 to n x sub i$
│
│
────────────────────────────────────────────────────┴────────────────────────────────────────────────
Brackets and Braces
Left and right brackets, braces, and such, of proper height are made
with and
Source Text Result
────────────────────────────────────────────────────┬───────────────────────────────────────────────────────
│
left [ {x sup 2 + y sup 2} over alpha right ] ~=~ 1 │ $left [ {x sup 2 + y sup 2} over alpha right ] ~=~ 1$
│
│
────────────────────────────────────────────────────┴───────────────────────────────────────────────────────
Legal characters after and are braces, brackets, bars, and for ceiling
and floor, and for nothing at all (useful for a right-side-only
bracket). A char need not have a matching char.
Vertical Piles
Vertical piles of elements are made with and
Source Text Result
────────────────────────────────────────────────────┬───────────────────────────────
│
pile {a above bb above ccc} │ $pile {a above bb above ccc}$
│
│
────────────────────────────────────────────────────┴───────────────────────────────
Piles can have arbitrary numbers of elements; left aligns, and center
(but with different vertical spacing), and right aligns.
Matrices and Determinants
Matrices are made with
Source Text Result
────────────────────────────────────────────────────┬───────────────────
│
left | { matrix { │ $left | { matrix
lcol { x sub i above y sub 2 } │ { lcol { x sub i
ccol { 1 above 234 } } } right | │ above y sub 2 }
│ ccol { 1 above
│ 234 } } } right
│ |$
│
│
────────────────────────────────────────────────────┴───────────────────
In addition, there is for a right-aligned column.
Diacritical Marks
Diacritical marks are made with and
Source Text Result
────────────────────────────────────────────────────┬────────────────────────────
│
x dot = f(t) bar │ $x dot = f(t) bar$
│
│
────────────────────────────────────────────────────┼────────────────────────────
│
y dotdot bar ~=~ n under │ $y dotdot bar ~=~ n under$
│
│
────────────────────────────────────────────────────┼────────────────────────────
│
x vec ~=~ y dyad │ $x vec ~=~ y dyad$
│
│
────────────────────────────────────────────────────┴────────────────────────────
Point Sizes and Fonts
Point sizes and fonts can be changed with n or and n. Point sizes and
fonts can be changed globally in a document by n and n, or by the com‐
mand-line arguments and
Normally, subscripts and superscripts are reduced by 3 points from the
previous size; this can be changed by the command-line argument
Vertical Alignment
Successive display arguments can be lined up. Place before the desired
lineup point in the first equation; place at the place that is to line
up vertically in subsequent equations.
Shorthand Forms
Shorthand forms can be defined or existing keywords redefined with
defines a new token called thing that is replaced by replacement when‐
ever it appears thereafter. The % can be any character that does not
occur in replacement. The spaces around the % delimiters are required.
Other Keywords
Keywords such as ($sum$, standing for uppercase sigma), ($int$, inte‐
gral sign), ($inf$, infinity sign), and shorthands such as ($>=$,
($!=$, and ($->$) are recognized. Greek letters are spelled out in
uppercase or lowercase as desired, as in ($alpha$, standing for lower‐
case alpha) or ($GAMMA$, standing for uppercase gamma). Mathematical
words such as ($sin$), ($cos$), and ($log$) are made Roman automati‐
cally. four-character escapes, such as ($‡$, and ($·$, can be used
anywhere.
Verbatim Text
Strings enclosed in double quotes (string) are passed through
untouched; this permits keywords to be entered as text, and can be used
to communicate with when other methods fail. Details are given in the
manuals cited below.
Options
accepts the following options:
Define the characters
x and y as the start and end in-text delimiter characters. See
the subsection.
Change the font number globally for the output equations in the docu‐
ment to
n. See the subsection.
Reduce subscript and superscript point sizes by
n points from the normal size. See the subsection.
Change the point size globally for the output equations in the document
to
n. See the subsection.
Operands
file A file to be processed for constructs. If no file is specified,
reads from standard input. If a file is specified as reads from
standard input at that point in the sequence of files.
EXTERNAL INFLUENCES
Environment Variables
determines the interpretation of text as single- or multibyte charac‐
ters.
determines the language in which messages are displayed.
If is not specified in the environment or is set to the empty string,
the value of is used as a default for each unspecified or empty vari‐
able. If is not specified or is set to the empty string, a default of
"C" (see lang(5)) is used instead of If any internationalization vari‐
able contains an invalid setting, behaves as if all internationaliza‐
tion variables are set to "C". See environ(5).
International Code Set Support
Single- and multibyte character code sets are supported.
WARNINGS
To embolden digits, parentheses, etc., it is necessary to quote them,
as in . Also see the section in nroff(1).
Good practice dictates that if a delimiter is specified in a file, the
directive should be included at the end of the file to prevent undesir‐
able 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, output should be piped through
(see col(1)).
The display on devices that do not support partial line feeds is often
difficult to understand; Greek characters and other symbols are often
not well supported and can mismatched printing of bold words on the
same line (see a printed version of the subsection above). Consider
using "computer-program" coding instead.
SEE ALSOcol(1), mm(1), nroff(1), tbl(1), mm(5).
by B.W. Kernighan and L.L. Cherry.
by C. Scrocca. delim off
neqn(1)