Imported Upstream version 1.22.4
[platform/upstream/groff.git] / src / preproc / eqn / eqn.1.man
1 '\" t
2 .TH @G@EQN @MAN1EXT@ "@MDATE@" "groff @VERSION@"
3 .SH NAME
4 @g@eqn \- format equations for troff or MathML
5 .
6 .
7 .\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
8 .do nr eqn_C \n[.C]
9 .cp 0
10 .
11 .
12 .\" ====================================================================
13 .\" Legal Terms
14 .\" ====================================================================
15 .\"
16 .\" Copyright (C) 1989-2018 Free Software Foundation, Inc.
17 .\"
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.
21 .\"
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.
26 .\"
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.
32 .
33 .
34 .ie \n(.V<\n(.v \
35 .  ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
36 .el \
37 .  ds tx TeX
38 .
39 .
40 .\" ====================================================================
41 .SH SYNOPSIS
42 .\" ====================================================================
43 .
44 .SY @g@eqn
45 .OP \-rvCNR
46 .OP \-d xy
47 .OP \-T name
48 .OP \-M dir
49 .OP \-f F
50 .OP \-s n
51 .OP \-p n
52 .OP \-m n
53 .RI [ file
54 \&.\|.\|.\&]
55 .YS
56 .
57 .
58 .\" ====================================================================
59 .SH DESCRIPTION
60 .\" ====================================================================
61 .
62 This manual page describes the GNU version of
63 .BR eqn ,
64 which is part of the groff document formatting system.
65 .
66 .B eqn
67 compiles descriptions of equations embedded within
68 .B troff
69 input files into commands that are understood by
70 .BR troff .
71 .
72 Normally, it should be invoked using the
73 .B \-e
74 option of
75 .BR groff .
76 .
77 The syntax is quite compatible with Unix eqn.
78 .
79 The output of GNU
80 .B eqn
81 cannot be processed with Unix troff;
82 it must be processed with GNU troff.
83 .
84 If no files are given on the command line, the standard input is read.
85 .
86 A filename of
87 .B \-
88 causes the standard input to be read.
89 .
90 .
91 .LP
92 .B eqn
93 searches for the file
94 .I eqnrc
95 in the directories given with the
96 .B \-M
97 option first, then in
98 .IR @SYSTEMMACRODIR@ ,
99 .IR @LOCALMACRODIR@ ,
100 and finally in the standard macro directory
101 .IR @MACRODIR@ .
102 .
103 If it exists,
104 .B eqn
105 processes it before the other input files.
106 .
107 The
108 .B \-R
109 option prevents this.
110 .
111 .
112 .LP
113 GNU
114 .B eqn
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).
118 .
119 .
120 .\" ====================================================================
121 .SH OPTIONS
122 .\" ====================================================================
123 .
124 Whitespace is permitted between a command-line option and its argument.
125 .
126 .
127 .TP
128 .BI \-d xy
129 Specify delimiters
130 .I x
131 and\~\c
132 .I y
133 for the left and right end, respectively, of in-line equations.
134 .
135 Any
136 .B delim
137 statements in the source file overrides this.
138 .
139 .TP
140 .B \-C
141 Recognize
142 .B .EQ
143 and
144 .B .EN
145 even when followed by a character other than space or newline.
146 .
147 Also, the statement
148 .RB \[oq] "delim on" \[cq]
149 is not handled specially.
150 .
151 .TP
152 .B \-N
153 Don't allow newlines within delimiters.
154 .
155 This option allows
156 .B eqn
157 to recover better from missing closing delimiters.
158 .
159 .TP
160 .B \-v
161 Print the version number.
162 .
163 .TP
164 .B \-r
165 Only one size reduction.
166 .
167 .TP
168 .BI \-m n
169 The minimum point-size is\~\c
170 .IR n .
171 .
172 .B eqn
173 does not reduce the size of subscripts or superscripts to
174 a smaller size than\~\c
175 .IR n .
176 .
177 .TP
178 .BI \-T name
179 The output is for device
180 .IR name .
181 .
182 Normally, the only effect of this is to define a macro
183 .I name
184 with a value of\~\c
185 .BR 1 ;
186 .I eqnrc
187 uses this to provide definitions appropriate for the output device.
188 .
189 However, if the specified device is \[lq]MathML\[rq], the output is
190 MathML markup rather than troff commands, and
191 .I eqnrc
192 is not loaded at all.
193 .
194 The default output device is
195 .BR @DEVICE@ .
196 .
197 .TP
198 .BI \-M dir
199 Search
200 .I dir
201 for
202 .I eqnrc
203 before the default directories.
204 .
205 .TP
206 .B \-R
207 Don't load
208 .IR eqnrc .
209 .
210 .TP
211 .BI \-f F
212 This is equivalent to a
213 .BI gfont\  F
214 command.
215 .
216 .TP
217 .BI \-s n
218 This is equivalent to a
219 .BI gsize\  n
220 command.
221 .
222 This option is deprecated.
223 .B eqn
224 normally sets equations at whatever the current point size
225 is when the equation is encountered.
226 .
227 .TP
228 .BI \-p n
229 This says that subscripts and superscripts should be
230 .IR n \~points
231 smaller than the surrounding text.
232 .
233 This option is deprecated.
234 .
235 Normally
236 .B eqn
237 sets subscripts and superscripts at 70% of the size of the surrounding
238 text.
239 .
240 .
241 .\" ====================================================================
242 .SH USAGE
243 .\" ====================================================================
244 .
245 Only the differences between GNU
246 .B eqn
247 and Unix eqn are described here.
248 .
249 .
250 .LP
251 GNU
252 .B eqn
253 emits Presentation MathML output when invoked with the
254 .B "-T\~MathML"
255 option.
256 .
257 .
258 .LP
259 GNU eqn sets the input token
260 .B \&"..."
261 as three periods or low dots, rather than the three centered dots of
262 classic eqn.  To get three centered dots, write
263 .B "cdots"
264 or
265 .BR "cdot cdot cdot".
266 .
267 .
268 .LP
269 Most of the new features of the GNU
270 .B eqn
271 input language are based on \*(tx.
272 .
273 There are some references to the differences between \*(tx and GNU
274 .B eqn
275 below;
276 these may safely be ignored if you do not know \*(tx.
277 .
278 .
279 .\" ====================================================================
280 .SS Controlling delimiters
281 .\" ====================================================================
282 .
283 If not in compatibility mode,
284 .B eqn
285 recognizes
286 .
287 .RS
288 .LP
289 .B delim on
290 .RE
291 .
292 .LP
293 to restore the delimiters which have been previously disabled
294 with a call to
295 .RB \[oq] "delim off" \[cq].
296 .
297 If delimiters haven't been specified, the call has no effect.
298 .
299 .
300 .\" ====================================================================
301 .SS Automatic spacing
302 .\" ====================================================================
303 .
304 .B eqn
305 gives each component of an equation a type, and adjusts the spacing
306 between components using that type.
307 .
308 Possible types are described in the table below.
309 .
310 .
311 .TS
312 lB l.
313 ordinary        T{
314 an ordinary character such as \[oq]1\[cq] or
315 .RI \[oq] x \[cq]
316 T}
317 operator        T{
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
321 \*(Su
322 T}
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
330 .TE
331 .
332 .
333 .LP
334 Components of an equation
335 get a type in one of two ways.
336 .
337 .TP
338 .BI type\  t\ e
339 This yields an equation component that contains\~\c
340 .I e
341 but that has type\~\c
342 .IR t ,
343 where
344 .I t
345 is one of the types mentioned above.
346 .
347 For example,
348 .B times
349 is defined as
350 .
351 .RS
352 .IP
353 .B
354 type "binary" \e(mu
355 .RE
356 .
357 .IP
358 The name of the type doesn't have to be quoted, but quoting protects
359 from macro expansion.
360 .
361 .TP
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
367 .I text
368 from now on have type\~\c
369 .IR t .
370 For example,
371 .
372 .RS
373 .IP
374 .B
375 chartype "punctuation" .,;:
376 .RE
377 .
378 .IP
379 would make the characters \[oq].,;:\[cq] have type punctuation
380 whenever they subsequently appeared in an equation.
381 .
382 The type\~\c
383 .I t
384 can also be
385 .B letter
386 or
387 .BR digit ;
388 in these cases
389 .B chartype
390 changes the font type of the characters.
391 .
392 See subsection \[lq]Fonts\[rq] below.
393 .
394 .
395 .\" ====================================================================
396 .SS New primitives
397 .\" ====================================================================
398 .
399 .TP
400 .BI big\  e
401 Enlarges the expression it modifies; intended to have semantics like
402 CSS \[oq]large\[cq].
403 .
404 In troff output, the point size is increased by\~5; in MathML output,
405 the expression uses
406 .
407 .RS
408 .IP
409 .EX
410 <mstyle \%mathsize='big'>
411 .EE
412 .RE
413 .
414 .TP
415 .IB e1\  smallover\  e2
416 This is similar to
417 .BR over ;
418 .B smallover
419 reduces the size of
420 .I e1
421 and
422 .IR e2 ;
423 it also puts less vertical space between
424 .I e1
425 or
426 .I e2
427 and the fraction bar.
428 .
429 The
430 .B over
431 primitive corresponds to the \*(tx
432 .B \eover
433 primitive in display styles;
434 .B smallover
435 corresponds to
436 .B \eover
437 in non-display styles.
438 .
439 .TP
440 .BI vcenter\  e
441 This vertically centers
442 .I e
443 about the math axis.
444 .
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.
448 .
449 For example,
450 .B sum
451 is defined as
452 .
453 .RS
454 .IP
455 .B
456 { type "operator" vcenter size +5 \e(*S }
457 .RE
458 .
459 .IP
460 (Note that vcenter is silently ignored when generating MathML.)
461 .
462 .TP
463 .IB e1\  accent\  e2
464 This sets
465 .I e2
466 as an accent over
467 .IR e1 .
468 .I e2
469 is assumed to be at the correct height for a lowercase letter;
470 .I e2
471 is moved down according to whether
472 .I e1
473 is taller or shorter than a lowercase letter.
474 .
475 For example,
476 .B hat
477 is defined as
478 .
479 .RS
480 .IP
481 .B
482 accent { "^" }
483 .RE
484 .
485 .IP
486 .BR dotdot ,
487 .BR dot ,
488 .BR tilde ,
489 .BR vec ,
490 and
491 .B dyad
492 are also defined using the
493 .B accent
494 primitive.
495 .
496 .TP
497 .IB e1\  uaccent\  e2
498 This sets
499 .I e2
500 as an accent under
501 .IR e1 .
502 .I e2
503 is assumed to be at the correct height for a character without a descender;
504 .I e2
505 is moved down if
506 .I e1
507 has a descender.
508 .
509 .B utilde
510 is pre-defined using
511 .B uaccent
512 as a tilde accent below the baseline.
513 .
514 .TP
515 .BI split\ \[dq] text \[dq]
516 This has the same effect as simply
517 .
518 .RS
519 .IP
520 .I text
521 .RE
522 .
523 .IP
524 but
525 .I text
526 is not subject to macro expansion because it is quoted;
527 .I text
528 is split up and the spacing between individual characters is adjusted.
529 .
530 .TP
531 .BI nosplit\  text
532 This has the same effect as
533 .
534 .RS
535 .IP
536 .BI \[dq] text \[dq]
537 .RE
538 .
539 .IP
540 but because
541 .I text
542 is not quoted it is subject to macro expansion;
543 .I text
544 is not split up
545 and the spacing between individual characters is not adjusted.
546 .
547 .TP
548 .IB e\  opprime
549 This is a variant of
550 .B prime
551 that acts as an operator on\~\c
552 .IR e .
553 .
554 It produces a different result from
555 .B prime
556 in a case such as
557 .BR A\ opprime\ sub\ 1 :
558 with
559 .B opprime
560 the\~\c
561 .B 1
562 is tucked under the prime as a subscript to the\~\c
563 .B A
564 (as is conventional in mathematical typesetting),
565 whereas with
566 .B prime
567 the\~\c
568 .B 1
569 is a subscript to the prime character.
570 .
571 The precedence of
572 .B opprime
573 is the same as that of
574 .B bar
575 and
576 .BR under ,
577 which is higher than that of everything except
578 .B accent
579 and
580 .BR uaccent .
581 .
582 In unquoted text a\~\c
583 .B \[aq]
584 that is not the first character is treated like
585 .BR opprime .
586 .
587 .TP
588 .BI special\  text\ e
589 This constructs a new object from\~\c
590 .I e
591 using a
592 .BR @g@troff (@MAN1EXT@)
593 macro named
594 .IR text .
595 .
596 When the macro is called,
597 the string
598 .B 0s
599 contains the output for\~\c
600 .IR e ,
601 and the number registers
602 .BR 0w ,
603 .BR 0h ,
604 .BR 0d ,
605 .BR 0skern ,
606 and
607 .B 0skew
608 contain the width, height, depth, subscript kern, and skew of\~\c
609 .IR e .
610 .
611 (The
612 .I "subscript kern"
613 of an object says how much a subscript on that object should be tucked in;
614 the
615 .I skew
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.)
618 .
619 The macro must modify
620 .B 0s
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
623 of the object.
624 .
625 The number registers must also be modified so that they correspond to the
626 result.
627 .
628 .IP
629 For example, suppose you wanted a construct that \[oq]cancels\[cq] an
630 expression by drawing a diagonal line through it.
631 .
632 .RS
633 .IP
634 .ft B
635 .if t .ne 6+\n(.Vu
636 .br
637 \&.EQ
638 .br
639 define cancel 'special Ca'
640 .br
641 \&.EN
642 .br
643 \&.de Ca
644 .br
645 \&.\ \ ds 0s \e
646 .br
647 \eZ'\e\e*(0s'\e
648 .br
649 \ev'\e\en(0du'\e
650 .br
651 \eD'l \e\en(0wu -\e\en(0hu-\e\en(0du'\e
652 .br
653 \ev'\e\en(0hu'
654 .br
655 \&..
656 .ft
657 .RE
658 .
659 .IP
660 Then you could cancel an expression\~\c
661 .I e
662 with
663 .BI \%cancel\ {\  e\  }
664 .
665 .IP
666 Here's a more complicated construct that draws a box round an
667 expression:
668 .
669 .RS
670 .IP
671 .ft B
672 .if t .ne 11+\n(.Vu
673 \&.EQ
674 .br
675 define box 'special Bx'
676 .br
677 \&.EN
678 .br
679 \&.de Bx
680 .br
681 \&.\ \ ds 0s \e
682 .br
683 \eZ'\eh'1n'\e\e*(0s'\e
684 .br
685 \eZ'\e
686 .br
687 \ev'\e\en(0du+1n'\e
688 .br
689 \eD'l \e\en(0wu+2n 0'\e
690 .br
691 \eD'l 0 -\e\en(0hu-\e\en(0du-2n'\e
692 .br
693 \eD'l -\e\en(0wu-2n 0'\e
694 .br
695 \eD'l 0 \e\en(0hu+\e\en(0du+2n'\e
696 .br
697 \&'\e
698 .br
699 \eh'\e\en(0wu+2n'
700 .br
701 \&.\ \ nr 0w +2n
702 .br
703 \&.\ \ nr 0d +1n
704 .br
705 \&.\ \ nr 0h +1n
706 .br
707 \&..
708 .ft
709 .RE
710 .
711 .TP
712 .BI space\  n
713 A positive value of the integer\~\c
714 .I n
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.
718 .
719 This primitive provides an interface to
720 .BR groff 's
721 .B \ex
722 escape (but with opposite sign).
723 .
724 .IP
725 This keyword has no effect if the equation is part of a
726 .B pic
727 picture.
728 .
729 .
730 .\" ====================================================================
731 .SS Extended primitives
732 .\" ====================================================================
733 .
734 .TP
735 .BI col\  n\  {\  .\|.\|.\  }
736 .TQ
737 .BI ccol\  n\  {\  .\|.\|.\  }
738 .TQ
739 .BI lcol\  n\  {\  .\|.\|.\  }
740 .TQ
741 .BI rcol\  n\  {\  .\|.\|.\  }
742 .TQ
743 .BI pile\  n\  {\  .\|.\|.\  }
744 .TQ
745 .BI cpile\  n\  {\  .\|.\|.\  }
746 .TQ
747 .BI lpile\  n\  {\  .\|.\|.\  }
748 .TQ
749 .BI rpile\  n\  {\  .\|.\|.\  }
750 The integer value\~\c
751 .I n
752 (in hundredths of an em) increases the vertical spacing between rows,
753 using
754 .BR groff 's
755 .B \ex
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
759 is used.
760 .
761 .
762 .\" ====================================================================
763 .SS Customization
764 .\" ====================================================================
765 .
766 When
767 .B eqn
768 is generating troff markup, the appearance of equations is controlled
769 by a large number of parameters.
770 .
771 They have no effect when generating MathML mode, which pushes
772 typesetting and fine motions downstream to a MathML rendering engine.
773 .
774 These parameters can be set using the
775 .B set
776 command.
777 .
778 .TP
779 .BI set\  p\ n
780 This sets parameter\~\c
781 .I p
782 to value\~\c
783 .IR n ;
784 .IR n \~is
785 an integer.
786 .
787 For example,
788 .
789 .RS
790 .IP
791 .B
792 set x_height 45
793 .RE
794 .
795 .IP
796 says that
797 .B eqn
798 should assume an x\~height of 0.45\~ems.
799 .
800 .
801 .RS
802 .LP
803 Possible parameters are as follows.
804 .
805 Values are in units of hundredths of an em unless otherwise stated.
806 .
807 These descriptions are intended to be expository rather than
808 definitive.
809 .
810 .TP
811 .B minimum_size
812 .B eqn
813 doesn't set anything at a smaller point-size than this.
814 .
815 The value is in points.
816 .
817 .TP
818 .B fat_offset
819 The
820 .B fat
821 primitive emboldens an equation by overprinting two copies of the
822 equation horizontally offset by this amount.
823 .
824 This parameter is not used in MathML mode; instead, fat text uses
825 .
826 .RS
827 .IP
828 .EX
829 <mstyle mathvariant='double-struck'>
830 .EE
831 .RE
832 .
833 .TP
834 .B over_hang
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.
839 .
840 .TP
841 .B accent_width
842 When
843 .B bar
844 or
845 .B under
846 is applied to a single character,
847 the line is this long.
848 .
849 Normally,
850 .B bar
851 or
852 .B under
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.
856 .
857 .TP
858 .B delimiter_factor
859 Extensible delimiters produced with the
860 .B left
861 and
862 .B right
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.
866 .
867 .TP
868 .B delimiter_shortfall
869 Extensible delimiters produced with the
870 .B left
871 and
872 .B right
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.
876 .
877 .TP
878 .B null_delimiter_space
879 This much horizontal space is inserted on each side of a fraction.
880 .
881 .TP
882 .B script_space
883 The width of subscripts and superscripts is increased by this amount.
884 .
885 .TP
886 .B thin_space
887 This amount of space is automatically inserted after punctuation
888 characters.
889 .
890 .TP
891 .B medium_space
892 This amount of space is automatically inserted on either side of
893 binary operators.
894 .
895 .TP
896 .B thick_space
897 This amount of space is automatically inserted on either side of
898 relations.
899 .
900 .TP
901 .B x_height
902 The height of lowercase letters without ascenders such as \[oq]x\[cq].
903 .
904 .TP
905 .B axis_height
906 The height above the baseline of the center of characters such as
907 \[oq]\[pl]\[cq] and \[oq]\[mi]\[cq].
908 .
909 It is important that this value is correct for the font
910 you are using.
911 .
912 .TP
913 .B default_rule_thickness
914 This should set to the thickness of the
915 .B \e(ru
916 character, or the thickness of horizontal lines produced with the
917 .B \eD
918 escape sequence.
919 .
920 .TP
921 .B num1
922 The
923 .B over
924 command shifts up the numerator by at least this amount.
925 .
926 .TP
927 .B num2
928 The
929 .B smallover
930 command shifts up the numerator by at least this amount.
931 .
932 .TP
933 .B denom1
934 The
935 .B over
936 command shifts down the denominator by at least this amount.
937 .
938 .TP
939 .B denom2
940 The
941 .B smallover
942 command shifts down the denominator by at least this amount.
943 .
944 .TP
945 .B sup1
946 Normally superscripts are shifted up by at least this amount.
947 .
948 .TP
949 .B sup2
950 Superscripts within superscripts or upper limits
951 or numerators of
952 .B smallover
953 fractions are shifted up by at least this amount.
954 .
955 This is usually less than sup1.
956 .
957 .TP
958 .B sup3
959 Superscripts within denominators or square roots
960 or subscripts or lower limits are shifted up by at least
961 this amount.
962 .
963 This is usually less than sup2.
964 .
965 .TP
966 .B sub1
967 Subscripts are normally shifted down by at least this amount.
968 .
969 .TP
970 .B sub2
971 When there is both a subscript and a superscript, the subscript is
972 shifted down by at least this amount.
973 .
974 .TP
975 .B sup_drop
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.
978 .
979 .TP
980 .B sub_drop
981 The baseline of a subscript is at least this much below the bottom of
982 the object on which the subscript is set.
983 .
984 .TP
985 .B big_op_spacing1
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.
988 .
989 .TP
990 .B big_op_spacing2
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.
993 .
994 .TP
995 .B big_op_spacing3
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.
998 .
999 .TP
1000 .B big_op_spacing4
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.
1003 .
1004 .TP
1005 .B big_op_spacing5
1006 This much vertical space is added above and below limits.
1007 .
1008 .TP
1009 .B baseline_sep
1010 The baselines of the rows in a pile or matrix are normally this far
1011 apart.
1012 .
1013 In most cases this should be equal to the sum of
1014 .B num1
1015 and
1016 .BR denom1 .
1017 .
1018 .TP
1019 .B shift_down
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.
1022 .
1023 In most cases this should be equal to
1024 .BR axis_height .
1025 .
1026 .TP
1027 .B column_sep
1028 This much space is added between columns in a matrix.
1029 .
1030 .TP
1031 .B matrix_side_sep
1032 This much space is added at each side of a matrix.
1033 .
1034 .TP
1035 .B draw_lines
1036 If this is non-zero, lines are drawn using the
1037 .B \eD
1038 escape sequence, rather than with the
1039 .B \el
1040 escape sequence and the
1041 .B \e(ru
1042 character.
1043 .
1044 .TP
1045 .B body_height
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
1048 .BR \ex ).
1049 .
1050 The default value is 85.
1051 .
1052 .TP
1053 .B body_depth
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
1056 .BR \ex ).
1057 .
1058 The default value is 35.
1059 .
1060 .TP
1061 .B nroff
1062 If this is non-zero,
1063 then
1064 .B ndefine
1065 behaves like
1066 .B define
1067 and
1068 .B tdefine
1069 is ignored, otherwise
1070 .B tdefine
1071 behaves like
1072 .B define
1073 and
1074 .B ndefine
1075 is ignored.
1076 .
1077 The default value is\~0 (This is typically changed to\~1 by the
1078 .I eqnrc
1079 file for the
1080 .BR ascii ,
1081 .BR latin1 ,
1082 .BR utf8 ,
1083 and
1084 .B cp1047
1085 devices.)
1086 .
1087 .
1088 .LP
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" .
1092 .RE
1093 .
1094 .
1095 .\" ====================================================================
1096 .SS Macros
1097 .\" ====================================================================
1098 .
1099 Macros can take arguments.
1100 .
1101 In a macro body,
1102 .BI $ n
1103 where
1104 .I n
1105 is between 1 and\~9, is replaced by the
1106 .IR n th
1107 argument if the macro is called with arguments;
1108 if there are fewer than
1109 .IR n \~arguments,
1110 it is replaced by nothing.
1111 .
1112 A word containing a left parenthesis where the part of the word
1113 before the left parenthesis has been defined using the
1114 .B define
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.
1119 .
1120 .TP
1121 .BI sdefine\  name\ X\ anything\ X
1122 This is like the
1123 .B define
1124 command, but
1125 .I name
1126 is not recognized if called with arguments.
1127 .
1128 .TP
1129 .BI include\ \[dq] file \[dq]
1130 .TQ
1131 .BI copy\ \[dq] file \[dq]
1132 Include the contents of
1133 .I file
1134 .RB ( include
1135 and
1136 .B copy
1137 are synonyms).
1138 .
1139 Lines of
1140 .I file
1141 beginning with
1142 .B .EQ
1143 or
1144 .B .EN
1145 are ignored.
1146 .
1147 .TP
1148 .BI ifdef\  name\ X\ anything\ X
1149 If
1150 .I name
1151 has been defined by
1152 .B define
1153 (or has been automatically defined because
1154 .I name
1155 is the output device) process
1156 .IR anything ;
1157 otherwise ignore
1158 .IR anything .
1159 .
1160 .I X
1161 can be any character not appearing in
1162 .IR anything .
1163 .
1164 .TP
1165 .BI undef\  name
1166 Remove definition of
1167 .IR name ,
1168 making it undefined.
1169 .
1170 .
1171 .LP
1172 Besides the macros mentioned above, the following definitions are available:
1173 .BR Alpha ,
1174 .BR Beta ,
1175 \&.\|.\|.,
1176 .B Omega
1177 (this is the same as
1178 .BR ALPHA ,
1179 .BR BETA ,
1180 \&.\|.\|.,
1181 .BR OMEGA ),
1182 .B ldots
1183 (three dots on the base line), and
1184 .BR dollar .
1185 .
1186 .
1187 .\" ====================================================================
1188 .SS Fonts
1189 .\" ====================================================================
1190 .
1191 .B eqn
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.
1195 .
1196 The existing
1197 .B gfont
1198 command
1199 changes the font that is used as the italic font.
1200 .
1201 By default this is\~\c
1202 .BR I .
1203 The font that is used as the roman font can be changed using the new
1204 .B grfont
1205 command.
1206 .
1207 .TP
1208 .BI grfont\  f
1209 Set the roman font to\~\c
1210 .IR f .
1211 .
1212 .
1213 .LP
1214 The
1215 .B italic
1216 primitive uses the current italic font set by
1217 .BR gfont ;
1218 the
1219 .B roman
1220 primitive uses the current roman font set by
1221 .BR grfont .
1222 .
1223 There is also a new
1224 .B gbfont
1225 command, which changes the font used by the
1226 .B bold
1227 primitive.
1228 .
1229 If you only use the
1230 .BR roman ,
1231 .B italic
1232 and
1233 .B bold
1234 primitives to changes fonts within an equation, you can change all the
1235 fonts used by your equations just by using
1236 .BR gfont ,
1237 .B grfont
1238 and
1239 .B gbfont
1240 commands.
1241 .
1242 .
1243 .LP
1244 You can control which characters are treated as letters
1245 (and therefore set in italics) by using the
1246 .B chartype
1247 command described above.
1248 .
1249 A type of
1250 .B letter
1251 causes a character to be set in italic type.
1252 .
1253 A type of
1254 .B digit
1255 causes a character to be set in roman type.
1256 .
1257 .
1258 .\" ====================================================================
1259 .SH FILES
1260 .\" ====================================================================
1261 .
1262 .TP
1263 .I @MACRODIR@/eqnrc
1264 Initialization file.
1265 .
1266 .
1267 .\" ====================================================================
1268 .SH MATHML MODE LIMITATIONS
1269 .\" ====================================================================
1270 .
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
1273 be rendered.
1274 .
1275 It does not support fine control of motions and sizes to the same
1276 degree troff does.
1277 .
1278 Thus:
1279 .
1280 .IP *
1281 .B eqn
1282 parameters have no effect on the generated MathML.
1283 .
1284 .IP *
1285 The
1286 .BR special ,
1287 .BR up ,
1288 .BR down ,
1289 .BR fwd ,
1290 and
1291 .B back
1292 operations cannot be implemented, and yield a MathML
1293 \[oq]<merror>\[cq] message instead.
1294 .
1295 .IP *
1296 The
1297 .B vcenter
1298 keyword is silently ignored, as centering on the math axis is the
1299 MathML default.
1300 .
1301 .IP *
1302 Characters that
1303 .B eqn
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
1306 adjusted by hand.
1307 .
1308 .
1309 .LP
1310 As in its troff mode,
1311 .B eqn
1312 in MathML mode leaves the
1313 .B .EQ
1314 and
1315 .B .EN
1316 delimiters in place for displayed equations, but emits no explicit
1317 delimiters around inline equations.
1318 .
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
1321 boundaries.
1322 .
1323 .
1324 .LP
1325 See section \[lq]Bugs\[rq] below for translation limits specific to
1326 .BR eqn .
1327 .
1328 .
1329 .\" ====================================================================
1330 .SH BUGS
1331 .\" ====================================================================
1332 .
1333 Inline equations are set at the point size that is current at the
1334 beginning of the input line.
1335 .
1336 .
1337 .LP
1338 In MathML mode, the
1339 .B mark
1340 and
1341 .B lineup
1342 features don't work.
1343 .
1344 These could, in theory, be implemented with \[oq]<maligngroup>\[cq]
1345 elements.
1346 .
1347 .
1348 .LP
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].
1352 .
1353 This is allowed by the specification, but inefficient.
1354 .
1355 .
1356 .\" ====================================================================
1357 .SH "SEE ALSO"
1358 .\" ====================================================================
1359 .
1360 .BR groff (@MAN1EXT@),
1361 .BR @g@troff (@MAN1EXT@),
1362 .BR @g@pic (@MAN1EXT@),
1363 .BR groff_font (@MAN5EXT@),
1364 .I The\ \*[tx]book
1365 .
1366 .
1367 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
1368 .cp \n[eqn_C]
1369 .
1370 .
1371 .\" Local Variables:
1372 .\" mode: nroff
1373 .\" tab-width: 12
1374 .\" End:
1375 .\" vim: set filetype=groff tabstop=12: