neqn(1) neqn(1)
NAME [Toc] [Back]
neqn - format mathematical text for nroff
SYNOPSIS [Toc] [Back]
neqn [-dxy] [-sn] [-fn] [-pn] [file]...
Remarks [Toc] [Back]
The output of neqn is very device-dependent. See the WARNINGS section.
DESCRIPTION [Toc] [Back]
neqn is a preprocessor for nroff (see nroff(1)) for typesetting
mathematical text on typewriter-like terminals. Its invocation is
almost always one of the following two forms or equivalent:
neqn file... | nroff | col
tbl file... | neqn | nroff | col
If no files are specified (or if - is specified instead of file), neqn
reads from 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 nroff macro packages to get centering, numbering,
etc.
Delimiters [Toc] [Back]
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 the sequence
.EQ
delim xy
.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 the WARNINGS section). All text that is neither
between delimiters nor between .EQ and .EN is passed through
untouched.
Separators and Metacharacters [Toc] [Back]
Tokens within neqn 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.
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: August 2003
neqn(1) neqn(1)
Subscripts and Superscripts [Toc] [Back]
Subscripts and superscripts are produced using sub and sup as follows:
Source Text Result
_______________________________________________________________________
|
x sub j | x
| j
|
____________________________________________________|__________________
| 2
a sub k sup 2 | ak
____________________________________________________|__________________
|
| 2+y2
e sup {x sup 2 + y sup 2} | ex
|
____________________________________________________|__________________
Fractions [Toc] [Back]
Fractions are produced by using over:
Source Text Result
_______________________________________________________________________
| _
a over b | b
|
____________________________________________________|__________________
Square Roots [Toc] [Back]
sqrt produces square roots:
Source Text Result
_______________________________________________________________________
|
1 over sqrt {ax sup 2+bx+c} | _____1____
| \|ax2+bx+c
|
____________________________________________________|__________________
Upper and Lower Limits [Toc] [Back]
The keywords from and to specify lower and upper limits:
Source Text Result
_______________________________________________________________________
| n
lim from {n -> inf } sum from 0 to n x sub i | lim Rx
| n->oo0 i
|
____________________________________________________|__________________
Hewlett-Packard Company - 2 - HP-UX 11i Version 2: August 2003
neqn(1) neqn(1)
Brackets and Braces [Toc] [Back]
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 | |x | = 1
| | A |
____________________________________________________|__________________
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 char need not have a matching right
char.
Vertical Piles [Toc] [Back]
Vertical piles of elements are made with pile, lpile, cpile, and
rpile:
Source Text Result
_______________________________________________________________________
|
| a
pile {a above bb above ccc} | bb
| ccc
____________________________________________________|__________________
Piles can have arbitrary numbers of elements; lpile left aligns, pile
and cpile center (but with different vertical spacing), and rpile
right aligns.
Matrices and Determinants [Toc] [Back]
Matrices are made with matrix:
Source Text Result
_______________________________________________________________________
|
left | { matrix { | |xi 1 |
lcol { x sub i above y sub 2 } | | |
ccol { 1 above 234 } } } right | | |y2 234|
| | |
|
____________________________________________________|__________________
In addition, there is rcol for a right-aligned column.
Hewlett-Packard Company - 3 - HP-UX 11i Version 2: August 2003
neqn(1) neqn(1)
Diacritical Marks [Toc] [Back]
Diacritical marks are made with dot, dotdot, hat, tilde, bar, vec,
dyad, and under:
Source Text Result
_______________________________________________________________________
| . ____
x dot = f(t) bar | x=f(t)
|
____________________________________________________|__________________
|
| __
y dotdot bar ~=~ n under | y = _
|
____________________________________________________|__________________
| _ _
x vec ~=~ y dyad | x = y
|
____________________________________________________|__________________
Point Sizes and Fonts [Toc] [Back]
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.
Vertical Alignment [Toc] [Back]
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 [Toc] [Back]
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. The spaces around the % delimiters are
required.
Other Keywords [Toc] [Back]
Keywords such as sum (R, standing for uppercase sigma), int (^,
integral sign), inf (oo, infinity sign), and shorthands such as >= (_,
> overstruck by _), != (/, = overstruck by /), and -> (->) are
recognized. Greek letters are spelled out in uppercase or lowercase
as desired, as in alpha (A, standing for lowercase alpha) or GAMMA (G,
Hewlett-Packard Company - 4 - HP-UX 11i Version 2: August 2003
neqn(1) neqn(1)
standing for uppercase gamma). Mathematical words such as sin (sin),
cos (cos), and log (log) are made Roman automatically. nroff fourcharacter
escapes, such as \(dd (=, | overstruck by =, standing for
double dagger) and \(bu (+, o overstruck by +, standing for bullet),
can be used anywhere.
Verbatim Text [Toc] [Back]
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 nroff when other methods fail. Details are
given in the manuals cited below.
Options [Toc] [Back]
neqn accepts the following options:
-dxy Define the characters x and y as the start and end in-text
delimiter characters. See the Delimiters subsection.
-fn Change the font number globally for the output equations in the
document to n. See the Point Sizes and Fonts subsection.
-pn Reduce subscript and superscript point sizes by n points from the
normal size. See the Point Sizes and Fonts subsection.
-sn Change the point size globally for the output equations in the
document to n. See the Point Sizes and Fonts subsection.
Operands [Toc] [Back]
file A file to be processed for neqn constructs. If no file is
specified, neqn reads from standard input. If a file is
specified as -, neqn reads from standard input at that point in
the sequence of files.
EXTERNAL INFLUENCES [Toc] [Back]
Environment Variables
LC_CTYPE determines the interpretation of text as single- or multibyte
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 [Toc] [Back]
Single- and multibyte character code sets are supported.
Hewlett-Packard Company - 5 - HP-UX 11i Version 2: August 2003
neqn(1) neqn(1)
WARNINGS [Toc] [Back]
To embolden digits, parentheses, etc., it is necessary to quote them,
as in bold "12.3". Also see the WARNINGS section in 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 (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 Other Keywords subsection
above). Consider using "computer-program" coding instead.
SEE ALSO [Toc] [Back]
col(1), 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 - 6 - HP-UX 11i Version 2: August 2003 [ Back ] |