Manual Page Result
0
Command: neqn | Section: 1 | Source: Digital UNIX | File: neqn.1.gz
neqn(1) General Commands Manual neqn(1)
NAME
neqn, checkeq - Typesets mathematical equations and expressions
SYNOPSIS
neqn [ -dxy ] [ -pn ] [ -sn ] [ -fn ] [ file ... ] | nroff ...
checkeq [ file ... ]
DESCRIPTION
The neqn command is an nroff(1) preprocessor for displaying mathemati-
cal symbols and equations on terminals. Usage almost always involves
preprocessing an nroff source file with neqn and then piping the output
through nroff.
NOTE: neqn formatting works best on typesetting devices. Your termi-
nal might not be equipped to display equations and other math symbols
in a meaningful way. In fact, you might have difficulty viewing the
symbols and examples included in this reference page.
If no files are specified, neqn reads from the standard input. A line
beginning with .EQ marks the start of an equation; .EN at the beginning
of a line marks the end of an equation. Neither of these lines is al-
tered, so they can be defined in macro packages to produce centering,
numbering, and so on.
It is also possible to set two characters as delimiters; subsequent
text between delimiters is also treated as input to neqn. Delimiters
may be set to any two characters, such as x and y, with the command-
line argument -dxy or more commonly by placing delim xy between .EQ and
.EN. The left and right delimiters can be identical. Delimiters are
turned off by delim off. All text that is neither between delimiters
nor between .EQ and
The program checkeq reports missing or unbalanced delimiters and
.EQ/.EN pairs.
Tokens within neqn are separated by spaces, tabs, newlines, braces,
double quotation marks, tildes, or circumflexes. Braces { } are used
for grouping. Generally speaking, anywhere a single character could
appear, a complicated construction enclosed in braces can be used in-
stead. The tilde (~) represents a full space in the output; the cir-
cumflex (^) half as much.
Subscripts and superscripts are produced with the keywords sub and sup.
Fractions use the keyword over.
The sqrt keyword creates square roots.
The keywords from and to are used to express lower and upper limits.
Left and right brackets, braces, and so forth that encompass more than
one line are created with the left and right keywords and tildes. Le-
gal characters to use with left and right are {, }, , |, c (ceiling), f
(floor), and "", meaning 'nothing' (to use with the left keyword when
you want brackets or braces on the right side only). The right keyword
clause is optional.
Vertical piles of things are made with pile, lpile, rpile, and cpile.
There can be an arbitrary number of elements in a pile. You use lpile
to left-justify a vertical grouping and rpile to right-justify one.
The pile and cpile keywords create centered piles but have different
vertical spacing.
You use the matrix keyword to create matrixes. The lcol, ccol, and col
keywords are used with matrix to specify the alignment within the ma-
trix; that is a left-justified column, centered column, and right-jus-
tified column, respectively.
Diacritical marks are made with the following keywords: tab(!); l l .
T{ dot T}!T{ Produces a period (.) over the character preceding the
keyword. T} T{ dotdot T}!T{ Produces two periods (..) over the charac-
ter preceding the keyword. T} T{ hat T}!T{ Produces a circumflex (^)
over the character preceding the keyword. T} T{ tilde T}!T{ Produces a
tilde ( ) over the character preceding the keyword. T} T{ bar T}!T{
Produces a horizontal bar over the character preceding the keyword. T}
T{ vec T}!T{ Produces a left-pointing arrow over the character preced-
ing the keyword. T} T{ dyad T}!T{ Produces a bidirectional arrow over
the character preceding the keyword. T} T{ under T}!T{ Produces an un-
derscore under the character preceding the keyword. T}
Size and font changes are made with the following keywords: tab(!); l l
. T{ size n T}!T{ Specifies the size as n points. T} T{ size+n T}!T{
Increases the size n points. T} T{ size-n T}!T{ Decreases the size n
points. T} T{ roman T}!T{ Uses roman type font. T} T{ italic T}!T{
Uses italic type font. T} T{ bold T}!T{ Uses bold type font. T} T{
font n T}!T{ Uses the specified type font. T}
Size and font can be changed globally in a document by using the gsize
n and the gfont n keyword expressions or by the command-line arguments
-s n and -f n.
Normally subscripts and superscripts are reduced by three point sizes
from the previous size. You can change this default with the -p n com-
mand-line argument.
To aline successive display arguments, place the mark keyword before
the desired lineup point in the first equation. Then place the lineup
keyword at the place that is to line up vertically in subsequent equa-
tion lines.
New keywords or new forms of existing keywords can be defined with the
define keyword. For example, the following define expression defines
the new keyword cc to be C Language:
define cc % C Language %
Whenever cc appears in the source file, processing with neqn causes C
Language to appear in the preprocessed or output file. Note that the
delimiting character surrounding the replacement string can be any
character as long as it does not appear in the replacement string it-
self.
The following keywords are also recognized for typeset output: tab(~);
l l . T{ sum T}~T{ Produces a large Greek sigma indicating summation.
T} T{ int T}~T{ Produces an integration sign. T} T{ inf T}~T{ Produces
an infinity sign. T} T{ >= T}~T{ Produces a greater-than-or-equals
sign. T} T{ <= T}~T{ Produces a less-than-or-equals sign. T} T{ ->
T}~T{ Produces a right pointing arrow. T} T{ <- T}~T{ Produces a left
pointing arrow. T} T{ != T}~T{ Produces a not equal sign. T}
Greek letters are spelled out in the desired case, for example, alpha
or GAMMA. Mathematical words like sin, cos, log are output in roman
type automatically. Strings enclosed in double quotation marks (
"...") are passed through untouched; this feature permits keywords to
be entered as text.
RESTRICTIONS
To embolden digits, parentheses, and so on, you must enclose them in
quotation marks after the keyword bold. For example:
bold "12.3".
EXAMPLES
Input and output for x with subscript i: x sub i ---> x
i Input and output for x with subscript i and super-
script 2: x sub i sup 2 ---> x2
i Input and output for e with a superscript of
x squared plus y squared:
2 2
x +y e sup {x sup 2 + y sup 2}
---> e Input and output for the fraction q over r:
q q over r ---> _
r Input and output for the fraction of 1 over the
square root of a polynomial that includes a superscript:
1 1 over sqrt {as sup 2 +bx+c}
---> _________
2
\|ax +bx+c Input and output for an
expression with a lower and upper limit:
n lim from
{n-> inf } sum from 0 to n x sub i ---> lim Rxi
n->oo0 Input and
output for an expression with large left and right braces:
{ 2 y }
_2 left {x sup
2 = y sup 2 over alpha right} ~=~ 1 ---> {x +A } = 1
{ } Input and
output for a "pile" expression:
a pile { a above b above c }
---> b
c Input and output for an expres-
sion with a matrix: matrix {lcol { x sub i above y sub 2 } ccol { 1
above 2 }} --->
x 1
i
y 2
2
RELATED INFORMATION
nroff(1), tbl(1), ms(5), delim off
neqn(1)