4 Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
6 Copyright (C) 1989 - 2001, 2004, 2005, 2007
7 Free Software Foundation, Inc.
9 Permission is granted to make and distribute verbatim copies of
10 this manual provided the copyright notice and this permission notice
11 are preserved on all copies.
13 Permission is granted to copy and distribute modified versions of this
14 manual under the conditions for verbatim copying, provided that the
15 entire resulting derived work is distributed under the terms of a
16 permission notice identical to this one.
18 Permission is granted to copy and distribute translations of this
19 manual into another language, under the above conditions for modified
20 versions, except that this permission notice may be included in
21 translations approved by the Free Software Foundation instead of in
25 .do nr __compat \n[.C]
29 . ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
33 .\" Like TP, but if specified indent is more than half
34 .\" the current line-length - indent, use the default indent.
36 . ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
40 .\" The BSD man macros can't handle " in arguments to font change macros,
41 .\" so use \(ts instead of ".
45 .TH @U_P_EQN@ @MAN1EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@"
49 @L_P_EQN@ \- format equations for @T_ROFF@ or MathML
62 .RI [ files\|.\|.\|. ]
67 This manual page describes
69 which is part of the @T_ROFF@ document formatting system.
71 compiles descriptions of equations embedded within
73 input files into commands that are understood by
75 Normally, it should be invoked using the
79 The syntax is quite compatible with Unix eqn;
80 its output cannot be processed with Unix troff, however,
81 it must be processed with @L_TROFF@.
82 If no files are given on the command line, the standard input is read.
85 causes the standard input to be read.
91 in the directories given with the
94 .BR @SYSTEMMACRODIR@ ,
96 and finally in the standard macro directory
100 processes it before the other input files.
103 option prevents this.
107 does not provide the functionality of neqn:
108 it does not support low-resolution, typewriter-like devices
109 (although it may work adequately for very simple input).
120 for the left and right end, respectively, of in-line equations.
123 statements in the source file overrides this.
131 even when followed by a character other than space or newline.
134 Don't allow newlines within delimiters.
137 to recover better from missing closing delimiters.
141 Print the version number.
145 Only one size reduction.
149 The minimum point-size is\~\c
152 does not reduce the size of subscripts or superscripts to
153 a smaller size than\~\c
158 The output is for device
160 Normally, the only effect of this is to define a macro
165 uses this to provide definitions appropriate for the output device.
166 However, if the specified device is \[lq]MathML\[rq], the output is
167 MathML markup rather than troff commands, and
169 is not loaded at all.
170 The default output device is
179 before the default directories.
188 This is equivalent to a
194 This is equivalent to a
197 This option is deprecated.
199 normally sets equations at whatever the current point size
200 is when the equation is encountered.
204 This says that subscripts and superscripts should be
206 points smaller than the surrounding text.
207 This option is deprecated.
210 sets subscripts and superscripts at 70% of the size of the
215 Only the differences between
217 and Unix eqn are described here.
221 emits Presentation MathML output when invoked with the
226 @L_P_EQN@ sets the input token
228 as three periods or low dots, rather than the three centered dots of
229 classic eqn. To get three centered dots, write
232 .BR "cdot cdot cdot".
235 Most of the new features of the
237 input language are based on \*(tx.
238 There are some references to the differences between \*(tx and
241 these may safely be ignored if you do not know \*(tx.
244 .SS Automatic spacing
246 gives each component of an equation a type, and adjusts the spacing
247 between components using that type.
251 .TP \w'punctuation'u+2n
253 an ordinary character such as `1' or `\c
258 a large operator such as
260 .if \n(.g .if !c\(*S .ds Su the summation operator
265 a binary operator such as `\(pl';
269 a relation such as `=';
273 a opening bracket such as `(';
277 a closing bracket such as `)';
281 a punctuation character such as `,';
285 a subformula contained within brackets;
288 spacing that suppresses automatic spacing adjustment.
292 Components of an equation get a type in one of two ways.
296 This yields an equation component that contains\~\c
298 but that has type\~\c
302 is one of the types mentioned above.
314 The name of the type doesn't have to be quoted, but quoting protects
315 from macro expansion.
318 .BI chartype\ t\ text
319 Unquoted groups of characters are split up into individual characters,
320 and the type of each character is looked up;
321 this changes the type that is stored for each character;
322 it says that the characters in
324 from now on have type\~\c
331 chartype "punctuation" .,;:
335 would make the characters `.,;:' have type punctuation
336 whenever they subsequently appeared in an equation.
345 changes the font type of the characters.
353 Enlarges the expression it modifies; intended to have semantics like
355 In troff output, the point size is increased by\~5;
356 in MathML output, the expression uses
361 <mstyle \%mathsize='big'>
366 .IB e1\ smallover\ e2
374 it also puts less vertical space between
378 and the fraction bar.
381 primitive corresponds to the \*(tx
383 primitive in display styles;
387 in non-display styles.
391 This vertically centers
394 The math axis is the vertical position about which characters
395 such as `\(pl' and `\(mi' are centered; also it is the vertical position
396 used for the bar of fractions.
404 { type "operator" vcenter size +5 \e(*S }
408 (Note that vcenter is silently ignored when generating MathML.)
417 is assumed to be at the correct height for a lowercase letter;
419 is moved down according to whether
421 is taller or shorter than a lowercase letter.
439 are also defined using the
450 is assumed to be at the correct height for a character without a descender;
458 as a tilde accent below the baseline.
461 .BI split\ \(ts text \(ts
462 This has the same effect as simply
472 is not subject to macro expansion because it is quoted;
474 is split up and the spacing between individual characters is adjusted.
478 This has the same effect as
488 is not quoted it is subject to macro expansion;
491 and the spacing between individual characters is not adjusted.
497 that acts as an operator on\~\c
499 It produces a different result from
502 .BR A\ opprime\ sub\ 1 :
507 is tucked under the prime as a subscript to the\~\c
509 (as is conventional in mathematical typesetting),
514 is a subscript to the prime character.
517 is the same as that of
521 which is higher than that of everything except
525 In unquoted text a\~\c
527 that is not the first character is treated like
532 This constructs a new object from\~\c
535 .BR @L_TROFF@ (@MAN1EXT@)
538 When the macro is called,
541 contains the output for\~\c
543 and the number registers
550 contain the width, height, depth, subscript kern, and skew of\~\c
554 of an object says how much a subscript on that object should be tucked in;
557 of an object says how far to the right of the center of the object an
558 accent over the object should be placed.)
559 The macro must modify
561 so that it outputs the desired result with its origin at the current
562 point, and increase the current horizontal position by the width
564 The number registers must also be modified so that they correspond to the
568 For example, suppose you wanted a construct that `cancels' an expression
569 by drawing a diagonal line through it.
578 define cancel 'special Ca'
590 \eD'l \e\en(0wu -\e\en(0hu-\e\en(0du'\e
599 Then you could cancel an expression\~\c
602 .BI \%cancel\ {\ e\ }
605 Here's a more complicated construct that draws a box round an expression:
613 define box 'special Bx'
621 \eZ'\eh'1n'\e\e*(0s'\e
627 \eD'l \e\en(0wu+2n 0'\e
629 \eD'l 0 -\e\en(0hu-\e\en(0du-2n'\e
631 \eD'l -\e\en(0wu-2n 0'\e
633 \eD'l 0 \e\en(0hu+\e\en(0du+2n'\e
651 A positive value of the integer\~\c
653 (in hundredths of an em) sets the vertical spacing before the equation,
654 a negative value sets the spacing after the equation, replacing the
656 This primitive provides an interface to
659 escape (but with opposite sign).
662 This keyword has no effect if the equation is part of a
666 .SS Extended primitives
668 .BI col\ n\ {\ .\|.\|.\ }
670 .BI ccol\ n\ {\ .\|.\|.\ }
672 .BI lcol\ n\ {\ .\|.\|.\ }
674 .BI rcol\ n\ {\ .\|.\|.\ }
676 .BI pile\ n\ {\ .\|.\|.\ }
678 .BI cpile\ n\ {\ .\|.\|.\ }
680 .BI lpile\ n\ {\ .\|.\|.\ }
682 .BI rpile\ n\ {\ .\|.\|.\ }
683 The integer value\~\c
685 (in hundredths of an em) increases the vertical spacing between rows,
689 escape (the value has no effect in MathML mode).
690 Negative values are possible but have no effect.
691 If there is more than a single value given in a matrix, the biggest one
697 is generating troff markup, the appearance of equations is controlled
698 by a large number of parameters. They have no effect when generating
699 MathML mode, which pushes typesetting and fine motions downstream to
700 a MathML rendering engine.
701 These parameters can be set using the
707 This sets parameter\~\c
724 should assume an x\~height of 0.45\~ems.
728 Possible parameters are as follows.
729 Values are in units of hundredths of an em unless otherwise stated.
730 These descriptions are intended to be expository rather than
734 . TP \w'\fBdefault_rule_thickness'u+2n
739 doesn't set anything at a smaller point-size than this.
740 The value is in points.
746 primitive emboldens an equation
747 by overprinting two copies of the equation
748 horizontally offset by this amount.
749 This parameter is not used in MathML mode; instead, fat text uses
754 <mstyle mathvariant='double-struck'>
760 A fraction bar is longer by twice this amount than
761 the maximum of the widths of the numerator and denominator;
762 in other words, it overhangs the numerator and
763 denominator by at least this amount.
771 is applied to a single character,
772 the line is this long.
777 produces a line whose length is the width of the object to which it applies;
778 in the case of a single character,
779 this tends to produce a line that looks too long.
783 Extensible delimiters produced with the
787 primitives have a combined height and depth of at least this many
788 thousandths of twice the maximum amount by which the sub-equation that
789 the delimiters enclose extends away from the axis.
792 .B delimiter_shortfall
793 Extensible delimiters produced with the
797 primitives have a combined height and depth
798 not less than the difference of
799 twice the maximum amount by which the sub-equation that
800 the delimiters enclose extends away from the axis
804 .B null_delimiter_space
805 This much horizontal space is inserted
806 on each side of a fraction.
810 The width of subscripts and superscripts is increased by this amount.
814 This amount of space is automatically inserted after punctuation
819 This amount of space is automatically inserted on either side
824 This amount of space is automatically inserted on either side of
829 The height of lowercase letters without ascenders such as `x'.
833 The height above the baseline of the center of characters
834 such as `\(pl' and `\(mi'.
835 It is important that this value is correct for the font
839 .B default_rule_thickness
840 This should set to the thickness of the
842 character, or the thickness of horizontal lines produced with the
850 command shifts up the numerator by at least this amount.
856 command shifts up the numerator by at least this amount.
862 command shifts down the denominator by at least this amount.
868 command shifts down the denominator by at least this amount.
872 Normally superscripts are shifted up by at least this amount.
876 Superscripts within superscripts or upper limits
880 are shifted up by at least this amount.
881 This is usually less than sup1.
885 Superscripts within denominators or square roots
886 or subscripts or lower limits are shifted up by at least
888 This is usually less than sup2.
892 Subscripts are normally shifted down by at least this amount.
896 When there is both a subscript and a superscript, the subscript
897 is shifted down by at least this amount.
901 The baseline of a superscript is no more
902 than this much amount below the top of the object on
903 which the superscript is set.
907 The baseline of a subscript is at least this much below
908 the bottom of the object on which the subscript is set.
912 The baseline of an upper limit is at least this
913 much above the top of the object on which the limit is set.
917 The baseline of a lower limit is at least this
918 much below the bottom of the object on which the limit is set.
922 The bottom of an upper limit is at least this much above the
923 top of the object on which the limit is set.
927 The top of a lower limit is at least this much below
928 the bottom of the object on which the limit is set.
932 This much vertical space is added above and below limits.
936 The baselines of the rows in a pile or matrix are normally
938 In most cases this should be equal to the sum of
945 The midpoint between the top baseline and the bottom baseline
946 in a matrix or pile is shifted down by this much from the axis.
947 In most cases this should be equal to
952 This much space is added between columns in a matrix.
956 This much space is added at each side of a matrix.
960 If this is non-zero, lines are drawn using the
962 escape sequence, rather than with the
964 escape sequence and the
970 The amount by which the height of the equation exceeds this
971 is added as extra space before the line containing the equation
974 The default value is 85.
978 The amount by which the depth of the equation exceeds this
979 is added as extra space after the line containing the equation
982 The default value is 35.
1001 The default value is\~0
1002 (This is typically changed to\~1 by the
1013 A more precise description of the role of many of these
1014 parameters can be found in Appendix\~H of
1015 .IR "The \*(txbook" .
1019 Macros can take arguments.
1024 is between 1 and\~9,
1027 argument if the macro is called with arguments;
1028 if there are fewer than
1030 arguments, it is replaced by nothing.
1031 A word containing a left parenthesis where the part of the word
1032 before the left parenthesis has been defined using the
1035 is recognized as a macro call with arguments;
1036 characters following the left parenthesis
1037 up to a matching right parenthesis are treated as comma-separated
1039 commas inside nested parentheses do not terminate an argument.
1042 .BI sdefine\ name\ X\ anything\ X
1047 is not recognized if called with arguments.
1050 .BI include\ \(ts file \(ts
1052 .BI copy\ \(ts file \(ts
1053 Include the contents of
1068 .BI ifdef\ name\ X\ anything\ X
1073 (or has been automatically defined because
1075 is the output device)
1081 can be any character not appearing in
1086 Remove definition of
1088 making it undefined.
1091 Besides the macros mentioned above, the following definitions are available:
1096 (this is the same as
1102 (three dots on the base line),
1108 normally uses at least two fonts to set an equation:
1109 an italic font for letters,
1110 and a roman font for everything else.
1114 changes the font that is used as the italic font.
1115 By default this is\~\c
1117 The font that is used as the roman font can be changed
1124 Set the roman font to\~\c
1130 primitive uses the current italic font set by
1134 primitive uses the current roman font set by
1138 command, which changes the font used by the
1146 primitives to changes fonts within an equation,
1147 you can change all the fonts used by your equations
1156 You can control which characters are treated as letters
1157 (and therefore set in italics) by using the
1159 command described above.
1162 causes a character to be set in italic type.
1165 causes a character to be set in roman type.
1169 It is not possible to use the hash character (#) as a delimiter for
1173 .BR @L_P_TBL@ (@MAN1EXT@)
1180 .Tp \w'\fB@MACRODIR@/eqnrc'u+2n
1182 Initialization file.
1184 .SH MATHML MODE LIMITATIONS
1185 MathML is designed on the assumption that it cannot know the exact
1186 physical characteristics of the media and devices on which it will
1188 It does not support fine control of motions and sizes to the same
1194 parameters have no effect on the generated MathML.
1204 operations cannot be implemented, and yield a
1205 MathML `<merror>' message instead.
1210 keyword is silently ignored, as centering on the math axis is the
1216 over troff sets extra large \(en notably the integral sign \(en
1217 may appear too small and need to have their `<mstyle>' wrappers
1221 As in its troff mode,
1223 in MathML mode leaves the
1227 delimiters in place for displayed equations, but emits no explicit
1228 delimiters around inline equations.
1229 They can, however, be recognized as strings that begin with `<math>'
1230 and end with `</math>' and do not cross line boundaries.
1235 section for translation limits specific to
1240 Inline equations are set at the point size that is current at the
1241 beginning of the input line.
1247 features don't work.
1248 These could, in theory, be implemented with `<maligngroup>' elements.
1250 In MathML mode, each digit of a numeric literal gets a separate
1251 `<mn>\:</mn>' pair, and decimal points are tagged with `<mo>\:</mo>'.
1252 This is allowed by the specification, but inefficient.
1256 .BR @L_ROFF@ (@MAN1EXT@),
1257 .BR @L_TROFF@ (@MAN1EXT@),
1258 .BR @L_P_PIC@ (@MAN1EXT@),
1259 .BR @L_ROFF@-font (@MAN5EXT@),