.
define box ’special Bx’
.EN
.de Bx
. ds 0s \
\Z’\h’1n’\\*(0s’\
\Z’\
\v’\\n(0du+1n’\
\D’l \\n(0wu+2n 0’\
\D’l 0 -\\n(0hu-\\n(0du-2n’\
\D’l -\\n(0wu-2n 0’\
\D’l 0 \\n(0hu+\\n(0du+2n’\
’\
\h’\\n(0wu+2n’
. nr 0w +2n
. nr 0d +1n
. nr 0h +1n
..
- space n
- A positive value of the integer~n (in hundredths of an em) sets
the vertical spacing before the equation, a negative value sets the spacing
after the equation, replacing the default values. This primitive provides
an interface to groff’s \x escape (but with opposite sign).
- This keyword
has no effect if the equation is part of a
- pic picture.
- col n { ... }
- ccol n { ... } lcol n { ... } rcol n { ... } pile n { ... } cpile n { ... } lpile n { ... } rpile n { ... } The integer
value~n (in hundredths of an em) increases the vertical spacing between
rows, using groff’s \x escape (the value has no effect in MathML mode). Negative
values are possible but have no effect. If there is more than a single value
given in a matrix, the biggest one is used.
When eqn is generating
troff markup, the appearance of equations is controlled by a large number
of parameters. They have no effect when generating MathML mode, which
pushes typesetting and fine motions downstream to a MathML rendering engine.
These parameters can be set using the set command.
- set p n
- This sets parameter~p
to value~n; n~is an integer. For example,
- set x_height 45
- says that
- eqn
should assume an x~height of 0.45~ems.
Possible parameters are as follows.
Values are in units of hundredths of an em unless otherwise stated. These
descriptions are intended to be expository rather than definitive.
- minimum_size
- eqn doesn’t set anything at a smaller point-size than this. The value is in
points.
- fat_offset
- The fat primitive emboldens an equation by overprinting
two copies of the equation horizontally offset by this amount. This parameter
is not used in MathML mode; instead, fat text uses
- <mstyle mathvariant=’double-struck’>
-
- over_hang
- A fraction bar is longer by twice this amount than the maximum
of the widths of the numerator and denominator; in other words, it overhangs
the numerator and denominator by at least this amount.
- accent_width
- When
bar or under is applied to a single character, the line is 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.
- delimiter_factor
- Extensible delimiters produced
with the left and right primitives have a combined height and depth of
at least this many thousandths of twice the maximum amount by which the
sub-equation that the delimiters enclose extends away from the axis.
- delimiter_shortfall
- Extensible delimiters produced with the left and right primitives have
a combined height and depth not less than the difference of twice the maximum
amount by which the sub-equation that the delimiters enclose extends away
from the axis and this amount.
- null_delimiter_space
- This much horizontal
space is inserted on each side of a fraction.
- script_space
- The width of
subscripts and superscripts is increased by this amount.
- thin_space
- This
amount of space is automatically inserted after punctuation characters.
- medium_space
- This amount of space is automatically inserted on either
side of binary operators.
- thick_space
- This amount of space is automatically
inserted on either side of relations.
- x_height
- The height of lowercase
letters without ascenders such as ‘x’.
- axis_height
- The height above the baseline
of the center of characters such as ‘+’ and ‘-’. It is important that this value
is correct for the font you are using.
- default_rule_thickness
- This should
set to the thickness of the \(ru character, or the thickness of horizontal
lines produced with the \D escape sequence.
- num1
- The over command shifts
up the numerator by at least this amount.
- num2
- The smallover command shifts
up the numerator by at least this amount.
- denom1
- The over command shifts
down the denominator by at least this amount.
- denom2
- The smallover command
shifts down the denominator by at least this amount.
- sup1
- Normally superscripts
are shifted up by at least this amount.
- sup2
- Superscripts within superscripts
or upper limits or numerators of smallover fractions are shifted up by
at least this amount. This is usually less than sup1.
- sup3
- Superscripts
within denominators or square roots or subscripts or lower limits are shifted
up by at least this amount. This is usually less than sup2.
- sub1
- Subscripts
are normally shifted down by at least this amount.
- sub2
- When there is both
a subscript and a superscript, the subscript is shifted down by at least
this amount.
- sup_drop
- The baseline of a superscript is no more than this
much amount below the top of the object on which the superscript is set.
- sub_drop
- The baseline of a subscript is at least this much below the bottom
of the object on which the subscript is set.
- big_op_spacing1
- The baseline
of an upper limit is at least this much above the top of the object on
which the limit is set.
- big_op_spacing2
- The baseline of a lower limit is
at least this much below the bottom of the object on which the limit is
set.
- big_op_spacing3
- The bottom of an upper limit is at least this much
above the top of the object on which the limit is set.
- big_op_spacing4
- The top of a lower limit is at least this much below the bottom of the
object on which the limit is set.
- big_op_spacing5
- This much vertical space
is added above and below limits.
- baseline_sep
- The baselines of the rows
in a pile or matrix are normally this far apart. In most cases this should
be equal to the sum of num1 and denom1.
- shift_down
- The midpoint between
the top baseline and the bottom baseline in a matrix or pile is shifted
down by this much from the axis. In most cases this should be equal to axis_height.
- column_sep
- This much space is added between columns in a matrix.
- matrix_side_sep
- This much space is added at each side of a matrix.
- draw_lines
- If this is
non-zero, lines are drawn using the \D escape sequence, rather than with
the \l escape sequence and the \(ru character.
- body_height
- The amount by
which the height of the equation exceeds this is added as extra space before
the line containing the equation (using \x). The default value is 85.
- body_depth
- The amount by which the depth of the equation exceeds this is added as
extra space after the line containing the equation (using \x). The default
value is 35.
- nroff
- If this is non-zero, then ndefine behaves like define
and tdefine is ignored, otherwise tdefine behaves like define and ndefine
is ignored. The default value is~0 (This is typically changed to~1 by the
eqnrc file for the ascii, latin1, utf8, and cp1047 devices.)
A more precise
description of the role of many of these parameters can be found in Appendix~H
of The book.
Macros can take arguments. In a macro body, $n where
n is between 1 and~9, is replaced by the n-th argument if the macro is called
with arguments; if there are fewer than n~arguments, it is 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 is
recognized as a macro call with arguments; characters following the left
parenthesis up to a matching right parenthesis are 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 is not
recognized if called with arguments.
- include tsfilets
- copy tsfilets Include
the contents of file (include and copy are synonyms). Lines of file beginning
with .EQ or .EN are ignored.
- ifdef name X anything X
- If name has been defined
by define (or has been automatically defined because name is the output
device) process anything; otherwise ignore anything. X can be any character
not appearing in anything.
- undef name
- Remove definition of name, making
it undefined.
Besides the macros mentioned above, the following definitions
are available: Alpha, Beta, ..., Omega (this is the same as ALPHA, BETA, ...,
OMEGA), ldots (three dots on the base line), and dollar.
eqn normally
uses at least two fonts to set an equation: an italic font for letters,
and a roman font for everything 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 commands.
You
can control which characters are treated as letters (and therefore set
in italics) by using the chartype command described above. A type of letter
causes a character to be set in italic type. A type of digit causes a character
to be set in roman type.
:((0w’/usr/share/groff/1.22.2/tmac/eqnrc’u+2n)*2u>(0u-0u))
.TP /usr/share/groff/1.22.2/tmac/eqnrc Initialization file.
Mathml Mode
Limitations
MathML is designed on the assumption that it cannot know the
exact physical characteristics of the media and devices on which it will
be rendered. It does not support fine control of motions and sizes to the
same degree troff does. Thus:
- *
- eqn parameters have no effect on the generated
MathML.
- *
- The special, up, down, fwd, and back operations cannot be implemented,
and yield a MathML ‘<merror>’ message instead.
- *
- The vcenter keyword is silently
ignored, as centering on the math axis is the MathML default.
- *
- Characters
that eqn over troff sets extra large en notably the integral sign en may
appear too small and need to have their ‘<mstyle>’ wrappers adjusted by hand.
As in its troff mode, eqn in MathML mode leaves the .EQ and .EN delimiters
in place for displayed equations, but emits no explicit delimiters around
inline equations. They can, however, be recognized as strings that begin
with ‘<math>’ and end with ‘</math>’ and do not cross line boundaries.
See the
BUGS section for translation limits specific to eqn.
Inline equations
are set at the point size that is current at the beginning of the input
line.
In MathML mode, the mark and lineup features don’t work. These could,
in theory, be implemented with ‘<maligngroup>’ elements.
In MathML mode, each
digit of a numeric literal gets a separate ‘<mn>:</mn>’ pair, and decimal points
are tagged with ‘<mo>:</mo>’. This is allowed by the specification, but inefficient.
groff(1)
, troff(1)
, pic(1)
, groff_font(5)
, The book
Table of Contents