EQN(1) BSD Reference Manual EQN(1) NNAAMMEE eqn - format equations for troff SSYYNNOOPPSSIISS eeqqnn [ --rrvvCCNNRR ] [ --dd_c_c ] [ --TT_n_a_m_e ] [ --MM_d_i_r ] [ --ff_F ] [ --ss_n ] [ --pp_n ] [ --mm_n ] [ _f_i_l_e_s... ] DDEESSCCRRIIPPTTIIOONN This manual page describes the GNU version of eeqqnn, which is part of the groff document formatting system. eeqqnn com- piles descriptions of equations embedded within ttrrooffff input files into commands that are understood 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 standard input will be read. A filename of -- will cause the standard input to be read. eeqqnn searches for the file eeqqnnrrcc using the path ..:://uussrr//sshhaarree//ttmmaacc:://uussrr//sshhaarree//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 adequately for very simple input). OOPPTTIIOONNSS --CC Recognize ..EEQQ and ..EENN even when followed by a char- acter 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. --mm_n The minimum point-size is _n. eqn will not reduce the size of subscripts or superscripts to a smaller size than _n. --TT_n_a_m_e The output is for device _n_a_m_e. The only effect of this is to define a macro _n_a_m_e with a value of 11. Typically eeqqnnrrcc will use this to provide defini- tions appropriate for the output device. The default output device is ppss. --MM_d_i_r Search _d_i_r for eeqqnnrrcc before the default Groff Version 1.08 6 October 1992 1 EQN(1) BSD Reference Manual EQN(1) directories. --RR Don't load eeqqnnrrcc. --ff_F This is equivalent to a ggffoonntt _F command. --ss_n This is equivalent to a ggssiizzee _n command. This option is deprecated. eqn will normally set equa- tions at whatever the current point size is when the equation is encountered. --pp_n 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. UUSSAAGGEE Only 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 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. Groff Version 1.08 6 October 1992 2 EQN(1) BSD Reference Manual EQN(1) ttyyppee _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, ttiimmeess is defined as ttyyppee ""bbiinnaarryy"" \\((mmuu The name of the type doesn't have to be quoted, but quoting protects from macro expansion. cchhaarrttyyppee _t _t_e_x_t 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 _t_e_x_t from now on have type _t. For example, cchhaarrttyyppee ""ppuunnccttuuaattiioonn"" ..,,;;:: would make the characters ..,,;;:: have type punctua- tion 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 _e_1 ssmmaalllloovveerr _e_2 This is similar to oovveerr; ssmmaalllloovveerr reduces the size of _e_1 and _e_2; it also puts less vertical space between _e_1 or _e_2 and the fraction bar. The oovveerr primitive corresponds to the TeX \\oovveerr primitive in display styles; ssmmaalllloovveerr corresponds to \\oovveerr in non-display styles. vvcceenntteerr _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, ssuumm is defined as {{ ttyyppee ""ooppeerraattoorr"" vvcceenntteerr ssiizzee ++55 \\((**SS }} _e_1 aacccceenntt _e_2 This sets _e_2 as an accent over _e_1. _e_2 is assumed to be at the correct height for a lowercase letter; _e_2 will be moved down according if _e_1 is taller or shorter than a lowercase letter. For example, hhaatt is defined as aacccceenntt {{ ""^^"" }} Groff Version 1.08 6 October 1992 3 EQN(1) BSD Reference Manual EQN(1) ddoottddoott, ddoott, ttiillddee, vveecc and ddyyaadd are also defined using the aacccceenntt primitive. _e_1 uuaacccceenntt _e_2 This sets _e_2 as an accent under _e_1. _e_2 is assumed to be at the correct height for a character without a descender; _e_2 will be moved down if _e_1 has a descender. uuttiillddee is pre-defined using uuaacccceenntt as a tilde accent below the baseline. sspplliitt ""_t_e_x_t"" This has the same effect as simply _t_e_x_t but _t_e_x_t is not subject to macro expansion because it is quoted; _t_e_x_t will be split up and the spacing between individual characters will be adjusted. nnoosspplliitt _t_e_x_t This has the same effect as ""_t_e_x_t"" but because _t_e_x_t is not quoted it will be subject to macro expansion; _t_e_x_t 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 the prime as a subscript to the AA (as is conventional in mathematical typeset- ting), whereas with pprriimmee the 11 will be a subscript to the prime character. The precedence of oopppprriimmee is the same as that of bbaarr and uunnddeerr, which is higher than that of everything except aacccceenntt and uuaacccceenntt. In unquoted text a '' that is not the first character will be treated like oopppprriimmee. ssppeecciiaall _t_e_x_t _e This constructs a new object from _e using a ttrrooffff(1) macro named _t_e_x_t. 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, sub- script kern, and skew of _e. (The _s_u_b_s_c_r_i_p_t _k_e_r_n of an object says how much a subscript on that object should be tucked in; the _s_k_e_w of an object says how Groff Version 1.08 6 October 1992 4 EQN(1) BSD Reference Manual EQN(1) 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 .... CCuussttoommiizzaattiioonn The appearance of equations is controlled by a large num- ber of parameters. These can be set using the sseett command. sseett _p _n This sets parameter _p to value _n _; _n is an integer. For example, sseett xx__hheeiigghhtt 4455 says that eeqqnn should assume an x height of 0.45 ems. Groff Version 1.08 6 October 1992 5 EQN(1) BSD Reference Manual EQN(1) 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. mmiinniimmuumm__ssiizzee eeqqnn will not set anything at a smaller point-size than this. The value is in points. ffaatt__ooffffsseett The ffaatt primitive emboldens an equation by overprinting two copies of the equation horizontally offset by this amount. oovveerr__hhaanngg 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. aacccceenntt__wwiiddtthh When bbaarr or uunnddeerr is applied to a single charac- ter, 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. ddeelliimmiitteerr__ffaaccttoorr Extensible delimiters pro- duced with the lleefftt and rriigghhtt 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. ddeelliimmiitteerr__sshhoorrttffaallll Extensible delimiters pro- duced with the lleefftt and rriigghhtt primitives will have Groff Version 1.08 6 October 1992 6 EQN(1) BSD Reference Manual EQN(1) 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. nnuullll__ddeelliimmiitteerr__ssppaaccee This much horizontal space is inserted on each side of a fraction. ssccrriipptt__ssppaaccee The width of subscripts and superscripts is increased by this amount. tthhiinn__ssppaaccee This amount of space is automatically inserted after punctuation charac- ters. mmeeddiiuumm__ssppaaccee This amount of space is automatically inserted on either side of binary oper- ators. tthhiicckk__ssppaaccee This amount of space is automatically inserted on either side of relations. xx__hheeiigghhtt The height of lowercase letters without ascenders such as x. aaxxiiss__hheeiigghhtt 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. ddeeffaauulltt__rruullee__tthhiicckknneessss This should set to the thickness of the \\((rruu char- acter, or the thickness of horizontal lines produced with the \\DD escape sequence. nnuumm11 The oovveerr command will shift up the numerator by at Groff Version 1.08 6 October 1992 7 EQN(1) BSD Reference Manual EQN(1) 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 super- scripts 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 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. ssuubb11 Subscripts will normally be shifted down by at least this amount. ssuubb22 When there is both a sub- script and a superscript, the subscript will be shifted down by at least this amount. ssuupp__ddrroopp 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. ssuubb__ddrroopp The baseline of a subscript will be at least this much Groff Version 1.08 6 October 1992 8 EQN(1) BSD Reference Manual EQN(1) below the bottom of the object on which the sub- script is set. bbiigg__oopp__ssppaacciinngg11 The baseline of an upper limit will be at least this much above the top of the object on which the limit is set. bbiigg__oopp__ssppaacciinngg22 The baseline of a lower limit will be at least this much below the bottom of the object on which the limit is set. bbiigg__oopp__ssppaacciinngg33 The bottom of an upper limit will be at least this much above the top of the object on which the limit is set. bbiigg__oopp__ssppaacciinngg44 The top of a lower limit will be at least this much below the bottom of the object on which the limit is set. bbiigg__oopp__ssppaacciinngg55 This much vertical space will be added above and below limits. bbaasseelliinnee__sseepp 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. sshhiifftt__ddoowwnn 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 aaxxiiss__hheeiigghhtt. ccoolluummnn__sseepp This much space will be added between columns in a matrix. Groff Version 1.08 6 October 1992 9 EQN(1) BSD Reference Manual EQN(1) mmaattrriixx__ssiiddee__sseepp This much space will be added at each side of a matrix. ddrraaww__lliinneess If this is non-zero, lines will be drawn using the \\DD escape sequence, rather than with the \\ll escape sequence and the \\((rruu char- acter. bbooddyy__hheeiigghhtt The amount by which the height of the equation exceeds this will be added as extra space before the line containing the equa- tion (using \\xx.) The default value is 85. bbooddyy__ddeepptthh The amount by which the depth of the equation exceeds this will be added as extra space after the line containing the equa- tion (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 typically changed to 1 by the eeqqnnrrcc file for the aasscciiii and llaattiinn11 devices.) A more precise description of the role of many of these parameters can be found in Appendix H of _T_h_e _T_e_X_b_o_o_k. MMaaccrrooss Macros can take arguments. In a macro body, $$_n where _n is between 1 and 9, will be replaced by the _n_-_t_h 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 ddeeffiinnee command will be recognized as a macro call with Groff Version 1.08 6 October 1992 10 EQN(1) BSD Reference Manual EQN(1) 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. ssddeeffiinnee _n_a_m_e _X _a_n_y_t_h_i_n_g _X This is like the ddeeffiinnee command, but _n_a_m_e will not be recognized if called with arguments. iinncclluuddee ""_f_i_l_e"" Include the contents of _f_i_l_e. Lines of _f_i_l_e begin- ning with ..EEQQ or ..EENN will be ignored. iiffddeeff _n_a_m_e _X _a_n_y_t_h_i_n_g _X If _n_a_m_e has been defined by ddeeffiinnee (or has been automatically defined because _n_a_m_e is the output device) process _a_n_y_t_h_i_n_g; otherwise ignore _a_n_y_- _t_h_i_n_g. _X can be any character not appearing in _a_n_y_t_h_i_n_g. FFoonnttss eeqqnn 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 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 com- mands. You can control which characters are treated as letters (and therefore set in italics) by using the cchhaarrttyyppee com- mand described above. A type of lleetttteerr will cause a char- acter to be set in italic type. A type of ddiiggiitt will cause a character to be set in roman type. FFIILLEESS //uussrr//sshhaarree//ttmmaacc//eeqqnnrrcc Initialization file. BBUUGGSS Inline equations will be set at the point size that is Groff Version 1.08 6 October 1992 11 EQN(1) BSD Reference Manual EQN(1) current at the beginning of the input line. SSEEEE AALLSSOO ggrrooffff(1), ttrrooffff(1), ggrrooffff__ffoonntt(5), _T_h_e _T_e_X_b_o_o_k Groff Version 1.08 6 October 1992 12