2 Copyright (C) 1989-2000 Free Software Foundation, Inc.
4 Permission is granted to make and distribute verbatim copies of
5 this manual provided the copyright notice and this permission notice
6 are preserved on all copies.
8 Permission is granted to copy and distribute modified versions of this
9 manual under the conditions for verbatim copying, provided that the
10 entire resulting derived work is distributed under the terms of a
11 permission notice identical to this one.
13 Permission is granted to copy and distribute translations of this
14 manual into another language, under the above conditions for modified
15 versions, except that this permission notice may be included in
16 translations approved by the Free Software Foundation instead of in
19 .ie \n(.V<\n(.v .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
21 .\" Like TP, but if specified indent is more than half
22 .\" the current line-length - indent, use the default indent.
24 .ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
27 .\" The BSD man macros can't handle " in arguments to font change macros,
28 .\" so use \(ts instead of ".
30 .TH @G@EQN @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
32 @g@eqn \- format equations for troff
41 .ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
42 .el .RB "[\ " "\\$1" "\ ]"
52 .RI "[\ " files\|.\|.\|. "\ ]"
56 It is possible to have whitespace between a command line option and its
59 This manual page describes the GNU version of
61 which is part of the groff document formatting system.
63 compiles descriptions of equations embedded within
65 input files into commands that are understood by
67 Normally, it should be invoked using the
71 The syntax is quite compatible with Unix eqn.
72 The output of GNU eqn cannot be processed with Unix troff;
73 it must be processed with GNU troff.
74 If no files are given on the command line, the standard input
78 will cause the standard input to be read.
85 If it exists, eqn will process it before the other input files.
90 GNU eqn does not provide the functionality of neqn:
91 it does not support low-resolution, typewriter-like devices
92 (although it may work adequately for very simple input).
100 even when followed by a character other than space or newline.
103 Don't allow newlines within delimiters.
106 to recover better from missing closing delimiters.
109 Print the version number.
112 Only one size reduction.
115 The minimum point-size is
117 eqn will not reduce the size of subscripts or superscripts to
122 The output is for device
124 The only effect of this is to define a macro
130 will use this to provide definitions appropriate for the output device.
131 The default output device is
139 before the default directories.
146 This is equivalent to a
151 This is equivalent to a
154 This option is deprecated.
155 eqn will normally set equations at whatever the current point size
156 is when the equation is encountered.
159 This says that subscripts and superscripts should be
161 points smaller than the surrounding text.
162 This option is deprecated.
163 Normally eqn makes sets subscripts and superscripts at 70%
164 of the size of the surrounding text.
166 Only the differences between GNU eqn and Unix eqn are described here.
168 Most of the new features of GNU eqn
170 There are some references to the differences between \*(tx and GNU eqn below;
171 these may safely be ignored if you do not know \*(tx.
172 .SS Automatic spacing
175 gives each component of an equation a type, and adjusts the spacing
176 between components using that type.
178 .TP \w'punctuation'u+2n
180 an ordinary character such as 1 or
184 a large operator such as
186 .if \n(.g .if !c\(*S .ds Su the summation operator
190 a binary operator such as +;
193 a relation such as =;
196 a opening bracket such as (;
199 a closing bracket such as );
202 a punctuation character such as ,;
205 a subformula contained within brackets;
208 spacing that suppresses automatic spacing adjustment.
210 Components of an equation get a type in one of two ways.
213 This yields an equation component that contains
219 is one of the types mentioned above.
229 The name of the type doesn't have to be quoted, but quoting protects
230 from macro expansion.
232 .BI chartype\ t\ text
233 Unquoted groups of characters are split up into individual characters,
234 and the type of each character is looked up;
235 this changes the type that is stored for each character;
236 it says that the characters in
238 from now on have type
244 chartype "punctuation" .,;:
247 would make the characters
249 have type punctuation
250 whenever they subsequently appeared in an equation.
259 changes the font type of the characters.
260 See the Fonts subsection.
263 .IB e1\ smallover\ e2
271 it also puts less vertical space between
275 and the fraction bar.
278 primitive corresponds to the \*(tx
280 primitive in display styles;
284 in non-display styles.
287 This vertically centers
290 The math axis is the vertical position about which characters
291 such as + and - are centered; also it is the vertical position
292 used for the bar of fractions.
299 { type "operator" vcenter size +5 \e(*S }
308 is assumed to be at the correct height for a lowercase letter;
310 will be moved down according if
312 is taller or shorter than a lowercase letter.
328 are also defined using the
338 is assumed to be at the correct height for a character without a descender;
340 will be moved down if
346 as a tilde accent below the baseline.
348 .BI split\ \(ts text \(ts
349 This has the same effect as simply
357 is not subject to macro expansion because it is quoted;
359 will be split up and the spacing between individual characters
363 This has the same effect as
371 is not quoted it will be subject to macro expansion;
374 and the spacing between individual characters will not be adjusted.
379 that acts as an operator on
381 It produces a different result from
384 .BR A\ opprime\ sub\ 1 :
389 will be tucked under the prime as a subscript to the
391 (as is conventional in mathematical typesetting),
396 will be a subscript to the prime character.
399 is the same as that of
403 which is higher than that of everything except
409 that is not the first character will be treated like
413 This constructs a new object from
416 .BR @g@troff (@MAN1EXT@)
419 When the macro is called,
422 will contain the output for
424 and the number registers
431 will contain the width, height, depth, subscript kern, and skew of
435 of an object says how much a subscript on that object should be tucked in;
438 of an object says how far to the right of the center of the object an
439 accent over the object should be placed.)
440 The macro must modify
442 so that it will output the desired result with its origin at the current
443 point, and increase the current horizontal position by the width
445 The number registers must also be modified so that they correspond to the
449 For example, suppose you wanted a construct that `cancels' an expression
450 by drawing a diagonal line through it.
456 define cancel 'special Ca'
459 \&.ds 0s \eZ'\e\e*(0s'\ev'\e\en(0du'\eD'l \e\en(0wu -\e\en(0hu-\e\en(0du'\ev'\e\en(0hu'
464 Then you could cancel an expression
469 Here's a more complicated construct that draws a box round an expression:
475 define box 'special Bx'
478 \&.ds 0s \eZ'\eh'1n'\e\e*(0s'\e
479 \eZ'\ev'\e\en(0du+1n'\eD'l \e\en(0wu+2n 0'\eD'l 0 -\e\en(0hu-\e\en(0du-2n'\e
480 \eD'l -\e\en(0wu-2n 0'\eD'l 0 \e\en(0hu+\e\en(0du+2n''\eh'\e\en(0wu+2n'
489 The appearance of equations is controlled by
490 a large number of parameters. These can be set using
511 should assume an x height of 0.45 ems.
514 Possible parameters are as follows.
515 Values are in units of hundredths of an em unless otherwise stated.
516 These descriptions are intended to be expository rather than
518 .TP \w'\fBdefault_rule_thickness'u+2n
521 will not set anything at a smaller point-size than this.
522 The value is in points.
527 primitive emboldens an equation
528 by overprinting two copies of the equation
529 horizontally offset by this amount.
532 A fraction bar will be longer by twice this amount than
533 the maximum of the widths of the numerator and denominator;
534 in other words, it will overhang the numerator and
535 denominator by at least this amount.
542 is applied to a single character,
543 the line will be this long.
548 produces a line whose length is the width of the object to which it applies;
549 in the case of a single character,
550 this tends to produce a line that looks too long.
553 Extensible delimiters produced with the
557 primitives will have a combined height and depth of at least this many
558 thousandths of twice the maximum amount by which the sub-equation that
559 the delimiters enclose extends away from the axis.
561 .B delimiter_shortfall
562 Extensible delimiters produced with the
566 primitives will have a combined height and depth
567 not less than the difference of
568 twice the maximum amount by which the sub-equation that
569 the delimiters enclose extends away from the axis
572 .B null_delimiter_space
573 This much horizontal space is inserted
574 on each side of a fraction.
577 The width of subscripts and superscripts is increased by this amount.
580 This amount of space is automatically inserted after punctuation
584 This amount of space is automatically inserted on either side
588 This amount of space is automatically inserted on either side of
592 The height of lowercase letters without ascenders such as x.
595 The height above the baseline of the center of characters
596 such as \(pl and \(mi.
597 It is important that this value is correct for the font
600 .B default_rule_thickness
601 This should set to the thickness of the
603 character, or the thickness of horizontal lines produced with the
610 command will shift up the numerator by at least this amount.
615 command will shift up the numerator by at least this amount.
620 command will shift down the denominator by at least this amount.
625 command will shift down the denominator by at least this amount.
628 Normally superscripts will be shifted up by at least this amount.
631 Superscripts within superscripts or upper limits
635 will be shifted up by at least this amount.
636 This is usually less than sup1.
639 Superscripts within denominators or square roots
640 or subscripts or lower limits will be shifted up by at least
642 This is usually less than sup2.
645 Subscripts will normally be shifted down by at least this amount.
648 When there is both a subscript and a superscript, the subscript
649 will be shifted down by at least this amount.
652 The baseline of a superscript will be no more
653 than this much amount below the top of the object on
654 which the superscript is set.
657 The baseline of a subscript will be at least this much below
658 the bottom of the object on which the subscript is set.
661 The baseline of an upper limit will be at least this
662 much above the top of the object on which the limit is set.
665 The baseline of a lower limit will be at least this
666 much below the bottom of the object on which the limit is set.
669 The bottom of an upper limit will be at least this much above the
670 top of the object on which the limit is set.
673 The top of a lower limit will be at least this much below
674 the bottom of the object on which the limit is set.
677 This much vertical space will be added above and below limits.
680 The baselines of the rows in a pile or matrix will normally be
682 In most cases this should be equal to the sum of
688 The midpoint between the top baseline and the bottom baseline
689 in a matrix or pile will be shifted down by this much from the axis.
690 In most cases this should be equal to
694 This much space will be added between columns in a matrix.
697 This much space will be added at each side of a matrix.
700 If this is non-zero, lines will be drawn using the
702 escape sequence, rather than with the
704 escape sequence and the
709 The amount by which the height of the equation exceeds this
710 will be added as extra space before the line containing the equation
713 The default value is 85.
716 The amount by which the depth of the equation exceeds this
717 will be added as extra space after the line containing the equation
720 The default value is 35.
738 The default value is 0
739 (This is typically changed to 1 by the
749 A more precise description of the role of many of these
750 parameters can be found in Appendix H of
754 Macros can take arguments.
760 will be replaced by the
762 argument if the macro is called with arguments;
763 if there are fewer than
765 arguments, it will be replaced by nothing.
766 A word containing a left parenthesis where the part of the word
767 before the left parenthesis has been defined using the
770 will be recognized as a macro call with arguments;
771 characters following the left parenthesis
772 up to a matching right parenthesis will be treated as comma-separated
774 commas inside nested parentheses do not terminate an argument.
776 .BI sdefine\ name\ X\ anything\ X
781 will not be recognized if called with arguments.
783 .BI include\ \(ts file \(ts
784 Include the contents of
794 .BI ifdef\ name\ X\ anything\ X
799 (or has been automatically defined because
801 is the output device)
807 can be any character not appearing in
811 normally uses at least two fonts to set an equation:
812 an italic font for letters,
813 and a roman font for everything else.
817 changes the font that is used as the italic font.
820 The font that is used as the roman font can be changed
826 Set the roman font to
831 primitive uses the current italic font set by
835 primitive uses the current roman font set by
839 command, which changes the font used by the
847 primitives to changes fonts within an equation,
848 you can change all the fonts used by your equations
856 You can control which characters are treated as letters
857 (and therefore set in italics) by using the
859 command described above.
862 will cause a character to be set in italic type.
865 will cause a character to be set in roman type.
867 .Tp \w'\fB@MACRODIR@/eqnrc'u+2n
871 Inline equations will be set at the point size that is current at the
872 beginning of the input line.
874 .BR groff (@MAN1EXT@),
875 .BR @g@troff (@MAN1EXT@),
876 .BR groff_font (@MAN5EXT@),