GEQN(@MAN1EXT@) 1990 GEQN(@MAN1EXT@)
NAME
geqn - groff equation formatter
SYNOPSIS
geqn [ -C ] [ -D ] [ -N ] [ -dcc ] [ -Tdev ] [ -r ] [ -v ]
[ -fF ] [ -sn ] [ -pn ] [ -mn ] [ files... ]
DESCRIPTION
geqn is a preprocessor for groff for formatting equations.
Normally, it should be invoked using the -e option of
groff. The syntax is quite compatible with eqn. The out-
put of geqn cannot be processed with ditroff; it must be
processed with gtroff. If no files are given on the com-
mand line, the standard input will be read. A filename of
- will cause the standard input to be read.
OPTIONS
-C Recognize .EQ and .EN even when followed by a char-
acter other than space or newline.
-D Draw fraction bars using the \D escape sequence,
rather than with the \l escape sequence and the
\(ru character.
-N Don't allow newlines within delimiters. This
option allows geqn to recover better from missing
closing delimiters.
-v Print the version number.
-r Only one size reduction.
-mn The minimum point-size is n. Geqn will not reduce
the size of subscripts or superscripts to a smaller
size than n.
-Tdev The output is for device dev. A macro whose name
is the name of the output device is automatically
defined with a value of 1. Nothing else depends on
what the output device is; geqn does not itself
read font or device description files. The default
output device is @DEVICE@.
-fF This is equivalent to a gfont F command.
-sn This is equivalent to a gsize n command. This
option is deprecated. Geqn will normally set equa-
tions at whatever the current point size is when
the equation is encountered.
-pn This says that subscripts and superscripts should
be n points smaller than the surrounding text.
This option is deprecated. Normally eqn makes sets
subscripts and superscripts at 70% of the size of
May 1 1
GEQN(@MAN1EXT@) 1990 GEQN(@MAN1EXT@)
the surrounding text.
USAGE
Only the differences between geqn and eqn are described
here.
Most of the new features of geqn are based on TeX. There
are some references to the differences between TeX and
geqn below; these may safely be ignored if you do not know
TeX.
Automatic spacing
geqn gives each component of an equation a type, and
adjusts the spacing between components using that type.
Possible types are:
ordinary an ordinary character such as 1 or x;
operator a large operator such as the summation opera-
tor;
binary a binary operator such as +;
relation a relation such as =;
opening a opening bracket such as (;
closing a closing bracket such as );
punctuation a punctutation character such as ,;
inner a subformula contained within brackets;
suppress spacing that suppresses automatic spacing
adjustment.
Components of an equation get a type in one of two ways.
type t e
This yields an equation component that contains e
but that has type t, where t is one of the types
mentioned above. For example, times is defined as
type "binary" \(mu
The name of the type doesn't have to be quoted, but
quoting protects from macro expansion.
chartype t text
Unquoted groups of characters are split up into
individual characters, and the type of each charac-
ter is looked up; this changes the type that is
stored for each character; it says that the charac-
ters in text from now on have type t. For example,
May 1 2
GEQN(@MAN1EXT@) 1990 GEQN(@MAN1EXT@)
chartype "punctuation" .,;:
would make the characters .,;: have type punctua-
tion whenever they subsequently appeared in an
equation. The type t can also be letter or digit;
in these cases chartype changes the font type of
the characters. See the Fonts subsection.
New primitives
e1 smallover e2
This is similar to over; smallover reduces the size
of e1 and e2; it also puts less vertical space
between e1 or e2 and the fraction bar. The over
primitive corresponds to the TeX \over primitive in
display styles; smallover corresponds to \over in
non-display styles.
vcenter e
This vertically centers e about the math axis. The
math axis is the vertical position about which
characters such as + and - are centered; also it is
the vertical position used for the bar of frac-
tions. For example, sum is defined as
{ type "operator" vcenter size +5 \(*S }
e1 accent e2
This sets e2 as an accent over e1. e2 is assumed
to be at the correct height for a lowercase letter;
e2 will be moved down according if e1 is taller or
shorter than a lowercase letter. For example, hat
is defined as
accent { "^" }
dotdot, dot, tilde, vec and dyad are also defined
using the accent primitive.
e1 uaccent e2
This sets e2 as an accent under e1. e2 is assumed
to be at the correct height for a character without
a descender; e2 will be moved down if e1 has a
descender. utilde is pre-defined using uaccent as
a tilde accent below the baseline.
split "text"
This has the same effect as simply
text
but text is not subject to macro expansion because
it is quoted; text will be split up and the spacing
between individual characters will be adjusted.
May 1 3
GEQN(@MAN1EXT@) 1990 GEQN(@MAN1EXT@)
nosplit text
This has the same effect as
"text"
but because text is not quoted it will be subject
to macro expansion; text will not be split up and
the spacing between individual characters will not
be adjusted.
e opprime
This is a variant of prime that acts as an operator
on e. It produces a different result from prime in
a case such as A opprime sub 1: with opprime the 1
will be tucked under the prime as a subscript to
the A (as is conventional in mathematical typeset-
ting), whereas with prime the 1 will be a subscript
to the prime character. The prcedence of opprime
is the same as that of bar and under, which is
higher than that of everything except accent and
uaccent. In unquoted text a ' that is not the
first character will be treated like opprime.
Customization
The appearance of equations is controlled by a large num-
ber of parameters. These can be set using the set command.
set p n
This sets parameter p to value n ; n is an integer.
For example,
set xheight 45
says that geqn should assume an x height of 0.45
ems.
Possible parameters are as follows. Values are in
units of hundreths of an em unless otherwise
stated. These descriptions are intended to be
expository rather than definitive.
minimumsize geqn will not set anything
at a smaller point-size
than this. The value is in
points.
fatoffset The fat primitive emboldens
an equation by overprinting
two copies of the equation
horizontally offset by this
amount.
overhang A fraction bar will be
longer by twice this amount
May 1 4
GEQN(@MAN1EXT@) 1990 GEQN(@MAN1EXT@)
than the maximum of the
widths of the numerator and
denominator; in other
words, it will overhang the
numerator and denominator
by at least this amount.
accentwidth When bar or under is
applied to a single charac-
ter, the line will be this
long. Normally, bar or
under produces a line whose
length is the width of the
object to which it applies;
in the case of a single
character, this tends to
produce a line that looks
too long.
delimiterfactor Extensible delimiters pro-
duced with the left and
right primitives will have
a combined height and depth
of at least this many thou-
sandths of twice the maxi-
mum amount by which the
sub-equation that the
delimiters enclose extends
away from the axis.
delimitershortfall Extensible delimiters pro-
duced with the left and
right primitives will have
a combined height and depth
not less than the differ-
ence of twice the maximum
amount by which the sub-
equation that the delim-
iters enclose extends away
from the axis and this
amount.
nulldelimiterspace This much horizontal space
is inserted on each side of
a fraction.
scriptspace The width of subscripts and
superscripts is increased
by this amount.
thinspace This amount of space is
automatically inserted
after punctuation charac-
ters.
May 1 5
GEQN(@MAN1EXT@) 1990 GEQN(@MAN1EXT@)
mediumspace This amount of space is
automatically inserted on
either side of binary oper-
ators.
thickspace This amount of space is
automatically inserted on
either side of relations.
xheight The height of lowercase
letters without ascenders
such as x.
axisheight The height above the base-
line of the center of char-
acters such as + and -. It
is important that this
value is correct for the
font you are using.
defaultrulethickness This should set to the
thickness of the \(ru char-
acter, or the thickness of
horizontal lines produced
with the \D escape
sequence.
num1 The over command will shift
up the numerator by at
least this amount.
num2 The smallover command will
shift up the numerator by
at least this amount.
denom1 The over command will shift
down the denominator by at
least this amount.
denom2 The smallover command will
shift down the denominator
by at least this amount.
sup1 Normally superscripts will
be shifted up by at least
this amount.
sup2 Superscripts within super-
scripts or upper limits or
numerators of smallover
fractions will be shifted
up by at least this amount.
This is usually less than
sup1.
May 1 6
GEQN(@MAN1EXT@) 1990 GEQN(@MAN1EXT@)
sup3 Superscripts within denomi-
nators or square roots or
subscripts or lower limits
will be shifted up by at
least this amount. This is
usually less than sup2.
sub1 Subscripts will normally be
shifted down by at least
this amount.
sub2 When there is both a sub-
script and a superscript,
the subscript will be
shifted down by at least
this amount.
supdrop The baseline of a super-
script will be no more than
this much amount below the
top of the object on which
the superscript is set.
subdrop The baseline of a subscript
will be at least this much
below the bottom of the
object on which the sub-
script is set.
bigopspacing1 The baseline of an upper
limit will be at least this
much above the top of the
object on which the limit
is set.
bigopspacing2 The baseline of a lower
limit will be at least this
much below the bottom of
the object on which the
limit is set.
bigopspacing3 The bottom of an upper
limit will be at least this
much above the top of the
object on which the limit
is set.
bigopspacing4 The top of a lower limit
will be at least this much
below the bottom of the
object on which the limit
is set.
bigopspacing5 This much vertical space
May 1 7
GEQN(@MAN1EXT@) 1990 GEQN(@MAN1EXT@)
will be added above and
below limits.
baselinesep The baselines of the rows
in a pile or matrix will
normally be this far apart.
In most cases this should
be equal to the sum of num1
and denom1.
shiftdown The midpoint between the
top baseline and the bottom
baseline in a matrix or
pile will be shifted down
by this much from the axis.
In most cases this should
be equal to axisheight.
columnsep This much space will be
added between columns in a
matrix.
matrixsidesep This much space will be
added at each side of a
matrix.
A more precise description of the role of many of
these parameters can be found in Appendix H of
The TeXbook.
Macros
Macros can take arguments. In a macro body, $n where n is
between 1 and 9, will be replaced by the n-th argument if
the macro is called with arguments; if there are fewer
than n arguments, it will be replaced by nothing. A word
containing a left parenthesis where the part of the word
before the left parenthesis has been defined using the
define command will be recognized as a macro call with
arguments; characters following the left parenthesis up to
a matching right parenthesis will be treated as comma-
separated arguments; commas inside nested parentheses do
not terminate an argument.
sdefine name X anything X
This is like the define command, but name will not
be recognized if called with argumenta.
include "file"
Include the contents of file. Lines of file begin-
ning with .EQ or .EN will be ignored.
ifdef name X anything X
If name has been defined by define (or has been
automatically defined because name is the output
May 1 8
GEQN(@MAN1EXT@) 1990 GEQN(@MAN1EXT@)
device) process anything; otherwise ignore any-
thing. X can be any character not appearing in
anything.
Fonts
geqn normally uses at least two fonts to set an equation:
an italic font for letters, and a roman font for every-
thing else. The existing gfont command changes the font
that is used as the italic font. By default this is I.
The font that is used as the roman font can be changed
using the new grfont command.
grfont f
Set the roman font to f.
The italic primitive uses the current italic font set by
gfont; the roman primitive uses the current roman font set
by grfont. There is also a new gbfont command, which
changes the font used by the bold primitive. If you only
use the roman, italic and bold primitives to changes fonts
within an equation, you can change all the fonts used by
your equations just by using gfont, grfont and gbfont com-
mands.
You can control which characters are treated as letters
(and therefore set in italics) by using the chartype com-
mand described above. A type of letter will cause a char-
acter to be set in italic type. A type of digit will
cause a character to be set in roman type.
SEE ALSO
groff(@MAN1EXT@), gtroff(@MAN1EXT@),
grofffont(@MAN5EXT@), The TeXbook
May 1 9