NAME
eqn - format equations for troff
SYNOPSIS
eeqqnn [ -rrvvCCNNRR ] [ -ddxy ] [ -TTname ] [ -MMdir ] [ -ffF ] [ -ssn ] [ -ppn ]
[ -mmn ] [ files... ]
It is possible to have whitespace between a command line option and its parameter.DESCRIPTION
This manual page describes the GNU version of eeqqnn, which is part of thegroff document formatting system. eeqqnn compiles descriptions of equa-
tions embedded within ttrrooffff input files into commands that are under-
stood by ttrrooffff. Normally, it should be invoked using the -ee option of
ggrrooffff. 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 standardinput will be read. A filename of - will cause the standard input to
be read.eeqqnn searches for the file eeqqnnrrcc in the directories given with the -MM
option first, then in //uussrr//lliibb//ggrrooffff//ssiittee-ttmmaacc, //uussrr//sshhaarree//ggrrooffff//ssiittee-
ttmmaacc, and finally in the standard macro directory//uussrr//sshhaarree//ggrrooffff//11..1199..11//ttmmaacc. If it exists, eqn will process it before
the other input files. The -RR 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 ade-
quately for very simple input). OOPPTTIIOONNSS-ddxy Specify delimiters x and y for the left and right end, respec-
tively, of in-line equations. Any ddeelliimm statements in the
source file overrides this.-CC Recognize ..EEQQ and ..EENN even when followed by a character other
than space or newline.-NN Don't allow newlines within delimiters. This option allows eeqqnn
to recover better from missing closing delimiters.-vv Print the version number.
-rr Only one size reduction.
-mmn The minimum point-size is n. eqn will not reduce the size of
subscripts or superscripts to a smaller size than n.-TTname The output is for device name. The only effect of this is to
define a macro name with a value of 11. Typically eeqqnnrrcc will use this to provide definitions appropriate for the output device. The default output device is ppss.-MMdir Search dir for eeqqnnrrcc before the default directories.
-RR Don't load eeqqnnrrcc.
-ffF This is equivalent to a ggffoonntt F command.
-ssn This is equivalent to a ggssiizzee n command. This option is depre-
cated. eqn will normally set equations at whatever the current
point size is when the equation is encountered.-ppn 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 the surrounding text. UUSSAAGGEEOnly the differences between GNU eqn and Unix eqn are described here.
Most of the new features of GNU eqn 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. AAuuttoommaattiicc ssppaacciinngg eeqqnn 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 >; 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 punctuation 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. ttyyppee t e This yields an equation component that contains e but that hastype t, where t is one of the types mentioned above. For exam-
ple, ttiimmeess is defined as ttyyppee ""bbiinnaarryy"" \\((mmuuThe name of the type doesn't have to be quoted, but quoting pro-
tects from macro expansion. cchhaarrttyyppee t textUnquoted groups of characters are split up into individual char-
acters, and the type of each character is looked up; this changes the type that is stored for each character; it says that the characters in text from now on have type t. For example, cchhaarrttyyppee ""ppuunnccttuuaattiioonn"" ..,,;;:: would make the characters ..,,;;:: have type punctuation whenever they subsequently appeared in an equation. The type t can also be lleetttteerr or ddiiggiitt; in these cases cchhaarrttyyppee changes the font type of the characters. See the Fonts subsection. NNeeww pprriimmiittiivveess e1 ssmmaalllloovveerr e2 This is similar to oovveerr; ssmmaalllloovveerr reduces the size of e1 and e2; it also puts less vertical space between e1 or e2 and the fraction bar. The oovveerr primitive corresponds to the TeX \\oovveerr primitive in display styles; ssmmaalllloovveerr corresponds to \\oovveerr innon-display styles.
vvcceenntteerr e This vertically centers e about the math axis. The math axis isthe vertical position about which characters such as + and - are
centered; also it is the vertical position used for the bar of fractions. For example, ssuumm is defined as {{ ttyyppee ""ooppeerraattoorr"" vvcceenntteerr ssiizzee ++55 \\((**SS }} e1 aacccceenntt 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, hhaatt is defined as aacccceenntt {{ ""^^"" }} ddoottddoott, ddoott, ttiillddee, vveecc and ddyyaadd are also defined using the aacccceenntt primitive. e1 uuaacccceenntt 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 bemoved down if e1 has a descender. uuttiillddee is pre-defined using
uuaacccceenntt as a tilde accent below the baseline. sspplliitt ""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 charac-
ters will be adjusted. nnoosspplliitt 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 oopppprriimmee This is a variant of pprriimmee that acts as an operator on e. It produces a different result from pprriimmee in a case such as AA oopppprriimmee ssuubb 11: with oopppprriimmee the 11 will be tucked under theprime as a subscript to the AA (as is conventional in mathemati-
cal typesetting), whereas with pprriimmee the 11 will be a subscript to the prime character. The precedence of oopppprriimmee is the sameas that of bbaarr and uunnddeerr, which is higher than that of every-
thing except aacccceenntt and uuaacccceenntt. In unquoted text a '' that is not the first character will be treated like oopppprriimmee. ssppeecciiaall text e This constructs a new object from e using a ttrrooffff(1) macro named text. When the macro is called, the string 00ss will contain the output for e, and the number registers 00ww, 00hh, 00dd, 00sskkeerrnn and 00sskkeeww will contain the width, height, depth, subscript kern, and skew of e. (The subscript kern of an object says how much a subscript on that object should be tucked in; the skew of an object says how far to the right of the center of the object an accent over the object should be placed.) The macro must modify 00ss so that it will output the desired result with its origin at the current point, and increase the current horizontal position by the width of the object. The number registers must also be modified so that they correspond to the result. For example, suppose you wanted a construct that `cancels' an expression by drawing a diagonal line through it. ..EEQQ ddeeffiinnee ccaanncceell ''ssppeecciiaall CCaa'' ..EENN ..ddee CCaa..ddss 00ss \\ZZ''\\\\**((00ss''\\vv''\\\\nn((00dduu''\\DD''ll \\\\nn((00wwuu -\\\\nn((00hhuu-\\\\nn((00dduu''\\vv''\\\\nn((00hhuu''
.... Then you could cancel an expression e with ccaanncceell {{ e }} Here's a more complicated construct that draws a box round an expression: ..EEQQ ddeeffiinnee bbooxx ''ssppeecciiaall BBxx'' ..EENN ..ddee BBxx ..ddss 00ss \\ZZ''\\hh''11nn''\\\\**((00ss''\\\\ZZ''\\vv''\\\\nn((00dduu++11nn''\\DD''ll \\\\nn((00wwuu++22nn 00''\\DD''ll 00 -\\\\nn((00hhuu-\\\\nn((00dduu-22nn''\\
\\DD''ll -\\\\nn((00wwuu-22nn 00''\\DD''ll 00 \\\\nn((00hhuu++\\\\nn((00dduu++22nn''''\\hh''\\\\nn((00wwuu++22nn''
..nnrr 00ww ++22nn ..nnrr 00dd ++11nn ..nnrr 00hh ++11nn .... CCuussttoommiizzaattiioonnThe appearance of equations is controlled by a large number of parame-
ters. These can be set using the sseett command. sseett p nThis sets parameter p to value n ; n is an integer. For exam-
ple, sseett xxhheeiigghhtt 4455 says that eeqqnn should assume an x height of 0.45 ems.Possible parameters are as follows. Values are in units of hun-
dredths of an em unless otherwise stated. These descriptions are intended to be expository rather than definitive. mmiinniimmuummssiizzee eeqqnn will not set anything at a smallerpoint-size than this. The value is in
points. ffaattooffffsseett The ffaatt primitive emboldens an equationby overprinting two copies of the equa-
tion horizontally offset by this amount. oovveerrhhaanngg A fraction bar will be longer by twice this amount 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. aacccceennttwwiiddtthh When bbaarr or uunnddeerr is applied to a single character, the line will be this long. Normally, bbaarr or uunnddeerr 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. ddeelliimmiitteerrffaaccttoorr Extensible delimiters produced with the lleefftt and rriigghhtt primitives will have a combined height and depth of at leastthis many thousandths of twice the maxi-
mum amount by which the sub-equation
that the delimiters enclose extends away from the axis. ddeelliimmiitteerrsshhoorrttffaallll Extensible delimiters produced with the lleefftt and rriigghhtt primitives will have a combined height and depth not less than the difference of twice the maximumamount by which the sub-equation that
the delimiters enclose extends away from the axis and this amount. nnuullllddeelliimmiitteerrssppaaccee This much horizontal space is inserted on each side of a fraction. ssccrriippttssppaaccee The width of subscripts and superscripts is increased by this amount. tthhiinnssppaaccee This amount of space is automatically inserted after punctuation characters. mmeeddiiuummssppaaccee This amount of space is automaticallyinserted on either side of binary opera-
tors. tthhiicckkssppaaccee This amount of space is automatically inserted on either side of relations. xxhheeiigghhtt The height of lowercase letters without ascenders such as x. aaxxiisshheeiigghhtt The height above the baseline of thecenter of characters such as + and -.
It is important that this value is cor-
rect for the font you are using. ddeeffaauullttrruulleetthhiicckknneessss This should set to the thickness of the\\((rruu character, or the thickness of hor-
izontal lines produced with the \\DD escape sequence. nnuumm11 The oovveerr command will shift up the numerator by at least this amount. nnuumm22 The ssmmaalllloovveerr command will shift up the numerator by at least this amount. ddeennoomm11 The oovveerr command will shift down the denominator by at least this amount. ddeennoomm22 The ssmmaalllloovveerr command will shift down the denominator by at least this amount. ssuupp11 Normally superscripts will be shifted up by at least this amount. ssuupp22 Superscripts within superscripts or upper limits or numerators of ssmmaalllloovveerr fractions will be shifted up by at least this amount. This is usually less than sup1. ssuupp33 Superscripts within denominators orsquare roots or subscripts or lower lim-
its will be shifted up by at least this amount. This is usually less than sup2. ssuubb11 Subscripts will normally be shifted down by at least this amount. ssuubb22 When there is both a subscript and a superscript, the subscript will be shifted down by at least this amount. ssuuppddrroopp The baseline of a superscript will be no more than this much amount below the top of the object on which the superscript is set. ssuubbddrroopp The baseline of a subscript will be at least this much below the bottom of the object on which the subscript is set. bbiiggooppssppaacciinngg11 The baseline of an upper limit will be at least this much above the top of the object on which the limit is set. bbiiggooppssppaacciinngg22 The baseline of a lower limit will be at least this much below the bottom of the object on which the limit is set. bbiiggooppssppaacciinngg33 The bottom of an upper limit will be at least this much above the top of the object on which the limit is set. bbiiggooppssppaacciinngg44 The top of a lower limit will be at least this much below the bottom of the object on which the limit is set. bbiiggooppssppaacciinngg55 This much vertical space will be added above and below limits. bbaasseelliinneesseepp 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 nnuumm11 and ddeennoomm11. sshhiiffttddoowwnn 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 aaxxiisshheeiigghhtt. ccoolluummnnsseepp This much space will be added between columns in a matrix. mmaattrriixxssiiddeesseepp This much space will be added at each side of a matrix.ddrraawwlliinneess If this is non-zero, lines will be drawn
using the \\DD escape sequence, rather than with the \\ll escape sequence and the \\((rruu character. bbooddyyhheeiigghhtt The amount by which the height of the equation exceeds this will be added as extra space before the line containing the equation (using \\xx.) The default value is 85. bbooddyyddeepptthh The amount by which the depth of the equation exceeds this will be added as extra space after the line containing the equation (using \\xx.) The default value is 35.nnrrooffff If this is non-zero, then nnddeeffiinnee will
behave like ddeeffiinnee and ttddeeffiinnee will be ignored, otherwise ttddeeffiinnee will behave like ddeeffiinnee and nnddeeffiinnee will be ignored.The default value is 0 (This is typi-
cally changed to 1 by the eeqqnnrrcc file for the aasscciiii, llaattiinn11, uuttff88, and ccpp11004477 devices.)A more precise description of the role of many of these parame-
ters can be found in Appendix H of The TeXbook. MMaaccrroossMacros 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 theddeeffiinnee command will be recognized as a macro call with arguments; char-
acters following the left parenthesis up to a matching right parenthe-
sis will be treated as comma-separated arguments; commas inside nested
parentheses do not terminate an argument. ssddeeffiinnee name X anything X This is like the ddeeffiinnee command, but name will not be recognized if called with arguments. iinncclluuddee ""file"" Include the contents of file. Lines of file beginning with ..EEQQ or ..EENN will be ignored. iiffddeeff name X anything X If name has been defined by ddeeffiinnee (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. FFoonnttss eeqqnn normally uses at least two fonts to set an equation: an italic font for letters, and a roman font for everything else. The existing ggffoonntt command changes the font that is used as the italic font. By default this is II. The font that is used as the roman font can be changed using the new ggrrffoonntt command. ggrrffoonntt f Set the roman font to f. The iittaalliicc primitive uses the current italic font set by ggffoonntt; the rroommaann primitive uses the current roman font set by ggrrffoonntt. There is also a new ggbbffoonntt command, which changes the font used by the bboolldd primitive. If you only use the rroommaann, iittaalliicc and bboolldd primitives to changes fonts within an equation, you can change all the fonts used by your equations just by using ggffoonntt, ggrrffoonntt and ggbbffoonntt commands. You can control which characters are treated as letters (and therefore set in italics) by using the cchhaarrttyyppee command described above. A type of lleetttteerr will cause a character to be set in italic type. A type of ddiiggiitt will cause a character to be set in roman type. FILES //uussrr//sshhaarree//ggrrooffff//11..1199..11//ttmmaacc//eeqqnnrrcc Initialization file.BUGS
Inline equations will be set at the point size that is current at the beginning of the input line.SEE ALSO
ggrrooffff(1), ttrrooffff(1), ggrrooffffffoonntt(5), The TeXbook Groff Version 1.19.1 5 October 2001 EQN(1)