2 .TH @G@EQN @MAN1EXT@ "@MDATE@" "groff @VERSION@"
4 @g@eqn \- format equations for troff or MathML
7 .\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
12 .\" ====================================================================
14 .\" ====================================================================
16 .\" Copyright (C) 1989-2018 Free Software Foundation, Inc.
18 .\" Permission is granted to make and distribute verbatim copies of this
19 .\" manual provided the copyright notice and this permission notice are
20 .\" preserved on all copies.
22 .\" Permission is granted to copy and distribute modified versions of
23 .\" this manual under the conditions for verbatim copying, provided that
24 .\" the entire resulting derived work is distributed under the terms of
25 .\" a permission notice identical to this one.
27 .\" Permission is granted to copy and distribute translations of this
28 .\" manual into another language, under the above conditions for
29 .\" modified versions, except that this permission notice may be
30 .\" included in translations approved by the Free Software Foundation
31 .\" instead of in the original English.
35 . ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
40 .\" ====================================================================
42 .\" ====================================================================
58 .\" ====================================================================
60 .\" ====================================================================
62 This manual page describes the GNU version of
64 which is part of the groff document formatting system.
67 compiles descriptions of equations embedded within
69 input files into commands that are understood by
72 Normally, it should be invoked using the
77 The syntax is quite compatible with Unix eqn.
81 cannot be processed with Unix troff;
82 it must be processed with GNU troff.
84 If no files are given on the command line, the standard input is read.
88 causes the standard input to be read.
95 in the directories given with the
98 .IR @SYSTEMMACRODIR@ ,
100 and finally in the standard macro directory
105 processes it before the other input files.
109 option prevents this.
115 does not provide the functionality of neqn:
116 it does not support low-resolution, typewriter-like devices
117 (although it may work adequately for very simple input).
120 .\" ====================================================================
122 .\" ====================================================================
124 Whitespace is permitted between a command-line option and its argument.
133 for the left and right end, respectively, of in-line equations.
137 statements in the source file overrides this.
145 even when followed by a character other than space or newline.
148 .RB \[oq] "delim on" \[cq]
149 is not handled specially.
153 Don't allow newlines within delimiters.
157 to recover better from missing closing delimiters.
161 Print the version number.
165 Only one size reduction.
169 The minimum point-size is\~\c
173 does not reduce the size of subscripts or superscripts to
174 a smaller size than\~\c
179 The output is for device
182 Normally, the only effect of this is to define a macro
187 uses this to provide definitions appropriate for the output device.
189 However, if the specified device is \[lq]MathML\[rq], the output is
190 MathML markup rather than troff commands, and
192 is not loaded at all.
194 The default output device is
203 before the default directories.
212 This is equivalent to a
218 This is equivalent to a
222 This option is deprecated.
224 normally sets equations at whatever the current point size
225 is when the equation is encountered.
229 This says that subscripts and superscripts should be
231 smaller than the surrounding text.
233 This option is deprecated.
237 sets subscripts and superscripts at 70% of the size of the surrounding
241 .\" ====================================================================
243 .\" ====================================================================
245 Only the differences between GNU
247 and Unix eqn are described here.
253 emits Presentation MathML output when invoked with the
259 GNU eqn sets the input token
261 as three periods or low dots, rather than the three centered dots of
262 classic eqn. To get three centered dots, write
265 .BR "cdot cdot cdot".
269 Most of the new features of the GNU
271 input language are based on \*(tx.
273 There are some references to the differences between \*(tx and GNU
276 these may safely be ignored if you do not know \*(tx.
279 .\" ====================================================================
280 .SS Controlling delimiters
281 .\" ====================================================================
283 If not in compatibility mode,
293 to restore the delimiters which have been previously disabled
295 .RB \[oq] "delim off" \[cq].
297 If delimiters haven't been specified, the call has no effect.
300 .\" ====================================================================
301 .SS Automatic spacing
302 .\" ====================================================================
305 gives each component of an equation a type, and adjusts the spacing
306 between components using that type.
308 Possible types are described in the table below.
314 an ordinary character such as \[oq]1\[cq] or
318 a large operator such as
319 .ds Su \[oq]\s+5\(*S\s0\[cq]
320 .if \n(.g .if !c\(*S .ds Su the summation operator
323 binary a binary operator such as \[oq]\[pl]\[cq]
324 relation a relation such as \[oq]=\[cq]
325 opening a opening bracket such as \[oq](\[cq]
326 closing a closing bracket such as \[oq])\[cq]
327 punctuation a punctuation character such as \[oq],\[cq]
328 inner a subformula contained within brackets
329 suppress a type that suppresses automatic spacing adjustment
334 Components of an equation
335 get a type in one of two ways.
339 This yields an equation component that contains\~\c
341 but that has type\~\c
345 is one of the types mentioned above.
358 The name of the type doesn't have to be quoted, but quoting protects
359 from macro expansion.
362 .BI chartype\ t\ text
363 Unquoted groups of characters are split up into individual characters,
364 and the type of each character is looked up;
365 this changes the type that is stored for each character;
366 it says that the characters in
368 from now on have type\~\c
375 chartype "punctuation" .,;:
379 would make the characters \[oq].,;:\[cq] have type punctuation
380 whenever they subsequently appeared in an equation.
390 changes the font type of the characters.
392 See subsection \[lq]Fonts\[rq] below.
395 .\" ====================================================================
397 .\" ====================================================================
401 Enlarges the expression it modifies; intended to have semantics like
404 In troff output, the point size is increased by\~5; in MathML output,
410 <mstyle \%mathsize='big'>
415 .IB e1\ smallover\ e2
423 it also puts less vertical space between
427 and the fraction bar.
431 primitive corresponds to the \*(tx
433 primitive in display styles;
437 in non-display styles.
441 This vertically centers
445 The math axis is the vertical position about which characters such as
446 \[oq]\[pl]\[cq] and \[oq]\[mi]\[cq] are centered; also it is the
447 vertical position used for the bar of fractions.
456 { type "operator" vcenter size +5 \e(*S }
460 (Note that vcenter is silently ignored when generating MathML.)
469 is assumed to be at the correct height for a lowercase letter;
471 is moved down according to whether
473 is taller or shorter than a lowercase letter.
492 are also defined using the
503 is assumed to be at the correct height for a character without a descender;
512 as a tilde accent below the baseline.
515 .BI split\ \[dq] text \[dq]
516 This has the same effect as simply
526 is not subject to macro expansion because it is quoted;
528 is split up and the spacing between individual characters is adjusted.
532 This has the same effect as
542 is not quoted it is subject to macro expansion;
545 and the spacing between individual characters is not adjusted.
551 that acts as an operator on\~\c
554 It produces a different result from
557 .BR A\ opprime\ sub\ 1 :
562 is tucked under the prime as a subscript to the\~\c
564 (as is conventional in mathematical typesetting),
569 is a subscript to the prime character.
573 is the same as that of
577 which is higher than that of everything except
582 In unquoted text a\~\c
584 that is not the first character is treated like
589 This constructs a new object from\~\c
592 .BR @g@troff (@MAN1EXT@)
596 When the macro is called,
599 contains the output for\~\c
601 and the number registers
608 contain the width, height, depth, subscript kern, and skew of\~\c
613 of an object says how much a subscript on that object should be tucked in;
616 of an object says how far to the right of the center of the object an
617 accent over the object should be placed.)
619 The macro must modify
621 so that it outputs the desired result with its origin at the current
622 point, and increase the current horizontal position by the width
625 The number registers must also be modified so that they correspond to the
629 For example, suppose you wanted a construct that \[oq]cancels\[cq] an
630 expression by drawing a diagonal line through it.
639 define cancel 'special Ca'
651 \eD'l \e\en(0wu -\e\en(0hu-\e\en(0du'\e
660 Then you could cancel an expression\~\c
663 .BI \%cancel\ {\ e\ }
666 Here's a more complicated construct that draws a box round an
675 define box 'special Bx'
683 \eZ'\eh'1n'\e\e*(0s'\e
689 \eD'l \e\en(0wu+2n 0'\e
691 \eD'l 0 -\e\en(0hu-\e\en(0du-2n'\e
693 \eD'l -\e\en(0wu-2n 0'\e
695 \eD'l 0 \e\en(0hu+\e\en(0du+2n'\e
713 A positive value of the integer\~\c
715 (in hundredths of an em) sets the vertical spacing before the
716 equation, a negative value sets the spacing after the equation,
717 replacing the default values.
719 This primitive provides an interface to
722 escape (but with opposite sign).
725 This keyword has no effect if the equation is part of a
730 .\" ====================================================================
731 .SS Extended primitives
732 .\" ====================================================================
735 .BI col\ n\ {\ .\|.\|.\ }
737 .BI ccol\ n\ {\ .\|.\|.\ }
739 .BI lcol\ n\ {\ .\|.\|.\ }
741 .BI rcol\ n\ {\ .\|.\|.\ }
743 .BI pile\ n\ {\ .\|.\|.\ }
745 .BI cpile\ n\ {\ .\|.\|.\ }
747 .BI lpile\ n\ {\ .\|.\|.\ }
749 .BI rpile\ n\ {\ .\|.\|.\ }
750 The integer value\~\c
752 (in hundredths of an em) increases the vertical spacing between rows,
756 escape (the value has no effect in MathML mode).
757 Negative values are possible but have no effect.
758 If there is more than a single value given in a matrix, the biggest one
762 .\" ====================================================================
764 .\" ====================================================================
768 is generating troff markup, the appearance of equations is controlled
769 by a large number of parameters.
771 They have no effect when generating MathML mode, which pushes
772 typesetting and fine motions downstream to a MathML rendering engine.
774 These parameters can be set using the
780 This sets parameter\~\c
798 should assume an x\~height of 0.45\~ems.
803 Possible parameters are as follows.
805 Values are in units of hundredths of an em unless otherwise stated.
807 These descriptions are intended to be expository rather than
813 doesn't set anything at a smaller point-size than this.
815 The value is in points.
821 primitive emboldens an equation by overprinting two copies of the
822 equation horizontally offset by this amount.
824 This parameter is not used in MathML mode; instead, fat text uses
829 <mstyle mathvariant='double-struck'>
835 A fraction bar is longer by twice this amount than
836 the maximum of the widths of the numerator and denominator;
837 in other words, it overhangs the numerator and
838 denominator by at least this amount.
846 is applied to a single character,
847 the line is this long.
853 produces a line whose length is the width of the object to which it applies;
854 in the case of a single character,
855 this tends to produce a line that looks too long.
859 Extensible delimiters produced with the
863 primitives have a combined height and depth of at least this many
864 thousandths of twice the maximum amount by which the sub-equation that
865 the delimiters enclose extends away from the axis.
868 .B delimiter_shortfall
869 Extensible delimiters produced with the
873 primitives have a combined height and depth not less than the
874 difference of twice the maximum amount by which the sub-equation that
875 the delimiters enclose extends away from the axis and this amount.
878 .B null_delimiter_space
879 This much horizontal space is inserted on each side of a fraction.
883 The width of subscripts and superscripts is increased by this amount.
887 This amount of space is automatically inserted after punctuation
892 This amount of space is automatically inserted on either side of
897 This amount of space is automatically inserted on either side of
902 The height of lowercase letters without ascenders such as \[oq]x\[cq].
906 The height above the baseline of the center of characters such as
907 \[oq]\[pl]\[cq] and \[oq]\[mi]\[cq].
909 It is important that this value is correct for the font
913 .B default_rule_thickness
914 This should set to the thickness of the
916 character, or the thickness of horizontal lines produced with the
924 command shifts up the numerator by at least this amount.
930 command shifts up the numerator by at least this amount.
936 command shifts down the denominator by at least this amount.
942 command shifts down the denominator by at least this amount.
946 Normally superscripts are shifted up by at least this amount.
950 Superscripts within superscripts or upper limits
953 fractions are shifted up by at least this amount.
955 This is usually less than sup1.
959 Superscripts within denominators or square roots
960 or subscripts or lower limits are shifted up by at least
963 This is usually less than sup2.
967 Subscripts are normally shifted down by at least this amount.
971 When there is both a subscript and a superscript, the subscript is
972 shifted down by at least this amount.
976 The baseline of a superscript is no more than this much amount below
977 the top of the object on which the superscript is set.
981 The baseline of a subscript is at least this much below the bottom of
982 the object on which the subscript is set.
986 The baseline of an upper limit is at least this much above the top of
987 the object on which the limit is set.
991 The baseline of a lower limit is at least this much below the bottom
992 of the object on which the limit is set.
996 The bottom of an upper limit is at least this much above the top of
997 the object on which the limit is set.
1001 The top of a lower limit is at least this much below the bottom of the
1002 object on which the limit is set.
1006 This much vertical space is added above and below limits.
1010 The baselines of the rows in a pile or matrix are normally this far
1013 In most cases this should be equal to the sum of
1020 The midpoint between the top baseline and the bottom baseline in a
1021 matrix or pile is shifted down by this much from the axis.
1023 In most cases this should be equal to
1028 This much space is added between columns in a matrix.
1032 This much space is added at each side of a matrix.
1036 If this is non-zero, lines are drawn using the
1038 escape sequence, rather than with the
1040 escape sequence and the
1046 The amount by which the height of the equation exceeds this is added
1047 as extra space before the line containing the equation (using
1050 The default value is 85.
1054 The amount by which the depth of the equation exceeds this is added as
1055 extra space after the line containing the equation (using
1058 The default value is 35.
1062 If this is non-zero,
1069 is ignored, otherwise
1077 The default value is\~0 (This is typically changed to\~1 by the
1089 A more precise description of the role of many of these
1090 parameters can be found in Appendix\~H of
1091 .IR "The \*(txbook" .
1095 .\" ====================================================================
1097 .\" ====================================================================
1099 Macros can take arguments.
1105 is between 1 and\~9, is replaced by the
1107 argument if the macro is called with arguments;
1108 if there are fewer than
1110 it is replaced by nothing.
1112 A word containing a left parenthesis where the part of the word
1113 before the left parenthesis has been defined using the
1115 command is recognized as a macro call with arguments; characters
1116 following the left parenthesis up to a matching right parenthesis are
1117 treated as comma-separated arguments; commas inside nested parentheses
1118 do not terminate an argument.
1121 .BI sdefine\ name\ X\ anything\ X
1126 is not recognized if called with arguments.
1129 .BI include\ \[dq] file \[dq]
1131 .BI copy\ \[dq] file \[dq]
1132 Include the contents of
1148 .BI ifdef\ name\ X\ anything\ X
1153 (or has been automatically defined because
1155 is the output device) process
1161 can be any character not appearing in
1166 Remove definition of
1168 making it undefined.
1172 Besides the macros mentioned above, the following definitions are available:
1177 (this is the same as
1183 (three dots on the base line), and
1187 .\" ====================================================================
1189 .\" ====================================================================
1192 normally uses at least two fonts to set an equation:
1193 an italic font for letters,
1194 and a roman font for everything else.
1199 changes the font that is used as the italic font.
1201 By default this is\~\c
1203 The font that is used as the roman font can be changed using the new
1209 Set the roman font to\~\c
1216 primitive uses the current italic font set by
1220 primitive uses the current roman font set by
1225 command, which changes the font used by the
1234 primitives to changes fonts within an equation, you can change all the
1235 fonts used by your equations just by using
1244 You can control which characters are treated as letters
1245 (and therefore set in italics) by using the
1247 command described above.
1251 causes a character to be set in italic type.
1255 causes a character to be set in roman type.
1258 .\" ====================================================================
1260 .\" ====================================================================
1264 Initialization file.
1267 .\" ====================================================================
1268 .SH MATHML MODE LIMITATIONS
1269 .\" ====================================================================
1271 MathML is designed on the assumption that it cannot know the exact
1272 physical characteristics of the media and devices on which it will
1275 It does not support fine control of motions and sizes to the same
1282 parameters have no effect on the generated MathML.
1292 operations cannot be implemented, and yield a MathML
1293 \[oq]<merror>\[cq] message instead.
1298 keyword is silently ignored, as centering on the math axis is the
1304 over troff sets extra large \(en notably the integral sign \(en may
1305 appear too small and need to have their \[oq]<mstyle>\[cq] wrappers
1310 As in its troff mode,
1312 in MathML mode leaves the
1316 delimiters in place for displayed equations, but emits no explicit
1317 delimiters around inline equations.
1319 They can, however, be recognized as strings that begin with
1320 \[oq]<math>\[cq] and end with \[oq]</math>\[cq] and do not cross line
1325 See section \[lq]Bugs\[rq] below for translation limits specific to
1329 .\" ====================================================================
1331 .\" ====================================================================
1333 Inline equations are set at the point size that is current at the
1334 beginning of the input line.
1342 features don't work.
1344 These could, in theory, be implemented with \[oq]<maligngroup>\[cq]
1349 In MathML mode, each digit of a numeric literal gets a separate
1350 \[oq]<mn>\:</mn>\[cq] pair, and decimal points are tagged with
1351 \[oq]<mo>\:</mo>\[cq].
1353 This is allowed by the specification, but inefficient.
1356 .\" ====================================================================
1358 .\" ====================================================================
1360 .BR groff (@MAN1EXT@),
1361 .BR @g@troff (@MAN1EXT@),
1362 .BR @g@pic (@MAN1EXT@),
1363 .BR groff_font (@MAN5EXT@),
1367 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
1371 .\" Local Variables:
1375 .\" vim: set filetype=groff tabstop=12: