info > EQN(1)

📖 NAME

eqn – format equations for troff or MathML

🚀 Quick Reference

Use CaseCommandDescription
⚡ Process equations with groffgroff -e fileInvoke eqn automatically via groff's -e option
🌐 Generate MathML outputeqn -T MathML fileOutput Presentation MathML instead of troff commands
🔤 Set custom equation delimiterseqn -dxy fileUse x and y as left/right inline equation delimiters
đŸšĢ Skip initialization fileeqn -R fileDo not load eqnrc
📏 Set minimum point sizeeqn -m n fileDo not reduce sub/superscripts below n points
đŸ–¨ī¸ Specify output deviceeqn -T name fileSet device name (e.g., ps, MathML)
📝 Inline equation delimitersdelim xy in sourceMark inline equations with x and y

📋 SYNOPSIS

eqn [-rvCNR] [-d xy] [-T name] [-M dir] [-f F] [-s n] [-p n] [-m n]
    [file ...]

📝 DESCRIPTION

This manual page describes the GNU version of eqn, which is part of the groff document formatting system. eqn compiles descriptions of equations embedded within troff input files into commands that are understood by troff. Normally, it should be invoked using the -e option of groff. The syntax is quite compatible with Unix eqn. The output of GNU eqn cannot be processed with Unix troff; it must be processed with GNU troff. If no files are given on the command line, the standard input is read. A filename of - causes the standard input to be read.

eqn searches for the file eqnrc in the directories given with the -M option first, then in /usr/lib/groff/site-tmac, /usr/share/groff/site-tmac, and finally in the standard macro directory /usr/share/groff/1.22.4/tmac. If it exists, eqn processes it before the other input files. The -R option prevents this.

GNU eqn does not provide the functionality of neqn: it does not support low-resolution, typewriter-like devices (although it may work adequately for very simple input).

âš™ī¸ OPTIONS

Whitespace is permitted between a command-line option and its argument.

💡 USAGE

Only the differences between GNU eqn and Unix eqn are described here.

GNU eqn emits Presentation MathML output when invoked with the -T MathML option.

GNU eqn sets the input token ... as three periods or low dots, rather than the three centered dots of classic eqn. To get three centered dots, write cdots or cdot cdot cdot.

Most of the new features of the GNU eqn input language are based on TeX. There are some references to the differences between TeX and GNU eqn below; these may safely be ignored if you do not know TeX.

đŸ”ļ Controlling delimiters

If not in compatibility mode, eqn recognizes

delim on

to restore the delimiters which have been previously disabled with a call to delim off. If delimiters haven't been specified, the call has no effect.

đŸ”ļ Automatic spacing

eqn gives each component of an equation a type, and adjusts the spacing between components using that type. Possible types are described in the table below.

TypeDescription
ordinaryan ordinary character such as '1' or 'x'
operatora large operator such as '<Sigma>'
binarya binary operator such as '+'
relationa relation such as '='
openinga opening bracket such as '('
closinga closing bracket such as ')'
punctuationa punctuation character such as ','
innera subformula contained within brackets
suppressa type that suppresses automatic spacing adjustment

Components of an equation get a type in one of two ways.

đŸ”ļ New primitives

đŸ”ļ Extended primitives

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.

đŸ”ļ Customization

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.

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.

ParameterDescription
minimum_sizeeqn doesn't set anything at a smaller point-size than this. The value is in points.
fat_offsetThe 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_hangA 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_widthWhen 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_factorExtensible 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_shortfallExtensible 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_spaceThis much horizontal space is inserted on each side of a fraction.
script_spaceThe width of subscripts and superscripts is increased by this amount.
thin_spaceThis amount of space is automatically inserted after punctuation characters.
medium_spaceThis amount of space is automatically inserted on either side of binary operators.
thick_spaceThis amount of space is automatically inserted on either side of relations.
x_heightThe height of lowercase letters without ascenders such as 'x'.
axis_heightThe 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_thicknessThis should set to the thickness of the \(ru character, or the thickness of horizontal lines produced with the \D escape sequence.
num1The over command shifts up the numerator by at least this amount.
num2The smallover command shifts up the numerator by at least this amount.
denom1The over command shifts down the denominator by at least this amount.
denom2The smallover command shifts down the denominator by at least this amount.
sup1Normally superscripts are shifted up by at least this amount.
sup2Superscripts within superscripts or upper limits or numerators of smallover fractions are shifted up by at least this amount. This is usually less than sup1.
sup3Superscripts within denominators or square roots or subscripts or lower limits are shifted up by at least this amount. This is usually less than sup2.
sub1Subscripts are normally shifted down by at least this amount.
sub2When there is both a subscript and a superscript, the subscript is shifted down by at least this amount.
sup_dropThe baseline of a superscript is no more than this much amount below the top of the object on which the superscript is set.
sub_dropThe baseline of a subscript is at least this much below the bottom of the object on which the subscript is set.
big_op_spacing1The baseline of an upper limit is at least this much above the top of the object on which the limit is set.
big_op_spacing2The baseline of a lower limit is at least this much below the bottom of the object on which the limit is set.
big_op_spacing3The bottom of an upper limit is at least this much above the top of the object on which the limit is set.
big_op_spacing4The top of a lower limit is at least this much below the bottom of the object on which the limit is set.
big_op_spacing5This much vertical space is added above and below limits.
baseline_sepThe 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_downThe 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_sepThis much space is added between columns in a matrix.
matrix_side_sepThis much space is added at each side of a matrix.
draw_linesIf this is non-zero, lines are drawn using the \D escape sequence, rather than with the \l escape sequence and the \(ru character.
body_heightThe 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_depthThe 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.
nroffIf 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 TeXbook.

đŸ”ļ Macros

Macros can take arguments. In a macro body, $n where n is between 1 and 9, is replaced by the nth 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.

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.

đŸ”ļ Fonts

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.

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.

📁 FILES

🌐 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:

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 section "Bugs" below for translation limits specific to eqn.

🐛 BUGS

🔗 SEE ALSO

EQN(1)
📖 NAME 🚀 Quick Reference 📋 SYNOPSIS 📝 DESCRIPTION âš™ī¸ OPTIONS 💡 USAGE
đŸ”ļ Controlling delimiters đŸ”ļ Automatic spacing đŸ”ļ New primitives đŸ”ļ Extended primitives đŸ”ļ Customization đŸ”ļ Macros đŸ”ļ Fonts
📁 FILES 🌐 MATHML MODE LIMITATIONS 🐛 BUGS 🔗 SEE ALSO

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-08-03 01:45 @216.73.216.10
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^