Debian Codegraph @

upstream/fedora-rawhide/man1/eqn.1

raw
1 '\" et
2 .TH \%eqn 1 "2026-03-03" "groff 1.24.0"
3 .SH Name
4 \%eqn \- format mathematics (equations) for
5 .I groff
6 or MathML
7 .
8 .
9 .\" ====================================================================
10 .\" Legal Terms
11 .\" ====================================================================
12 .\"
13 .\" Copyright 1989-2025 Free Software Foundation, Inc.
14 .\"
15 .\" Permission is granted to make and distribute verbatim copies of this
16 .\" manual provided the copyright notice and this permission notice are
17 .\" preserved on all copies.
18 .\"
19 .\" Permission is granted to copy and distribute modified versions of
20 .\" this manual under the conditions for verbatim copying, provided that
21 .\" the entire resulting derived work is distributed under the terms of
22 .\" a permission notice identical to this one.
23 .\"
24 .\" Permission is granted to copy and distribute translations of this
25 .\" manual into another language, under the above conditions for
26 .\" modified versions, except that this permission notice may be
27 .\" included in translations approved by the Free Software Foundation
28 .\" instead of in the original English.
29 .
30 .
31 .\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
32 .do nr *groff_eqn_1_man_C \n[.cp]
33 .cp 0
34 .
35 .\" Define fallback for groff 1.23's MR macro if the system lacks it.
36 .nr do-fallback 0
37 .if !\n(.f .nr do-fallback 1 \" mandoc
38 .if \n(.g .if !d MR .nr do-fallback 1 \" older groff
39 .if !\n(.g .nr do-fallback 1 \" non-groff *roff
40 .if \n[do-fallback] \{\
41 . de MR
42 . ie \\n(.$=1 \
43 . I \%\\$1
44 . el \
45 . IR \%\\$1 (\\$2)\\$3
46 . .
47 .\}
48 .rr do-fallback
49 .
50 .
51 .ie \n(.V<\n(.v \
52 . ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
53 .el \
54 . ds tx TeX
55 .
56 .
57 .\" ====================================================================
58 .SH Synopsis
59 .\" ====================================================================
60 .
61 .SY \%eqn
62 .RB [ \-CNrR ]
63 .RB [ \- d\~\c
64 .IR xy ]
65 .RB [ \-f\~\c
66 .IR global-italic-font ]
67 .RB [ \-m\~\c
68 .IR minimum-type-size ]
69 .RB [ \-M\~\c
70 .IR eqnrc-directory ]
71 .RB [ \-p\~\c
72 .IR super/subscript-size-reduction ]
73 .RB [ \-s\~\c
74 .IR global-type-size ]
75 .RB [ \-T\~\c
76 .IR device ]
77 .RI [ file\~ .\|.\|.]
78 .YS
79 .
80 .
81 .P
82 .SY \%eqn
83 .B \-\-help
84 .YS
85 .
86 .
87 .P
88 .SY \%eqn
89 .B \-v
90 .YS
91 .
92 .SY \%eqn
93 .B \%\-\-version
94 .YS
95 .
96 .
97 .\" ====================================================================
98 .SH Description
99 .\" ====================================================================
100 .
101 The GNU implementation of
102 .I eqn \" GNU
103 is part of the
104 .MR groff 7
105 document formatting system.
106 .
107 .I \%eqn
108 is a
109 .MR \%troff 1
110 preprocessor that translates expressions in its own language,
111 embedded in
112 .MR roff 7
113 input,
114 into mathematical notation typeset by
115 .MR \%troff 1 .
116 .
117 It copies each
118 .IR file 's
119 contents to the standard output stream,
120 translating each
121 .I equation
122 between lines starting with
123 .B .EQ
124 and
125 .BR .EN ,
126 or within a pair of user-specified delimiters.
127 .
128 Normally,
129 .I \%eqn
130 is not executed directly by the user,
131 but invoked by specifying the
132 .B \-e
133 option to
134 .MR groff 1 .
135 .
136 While GNU
137 .IR eqn 's \" GNU
138 input syntax is highly compatible with AT&T
139 .IR eqn , \" AT&T
140 the output
141 .I \%eqn
142 produces cannot be processed by AT&T
143 .IR troff ; \" AT&T
144 GNU
145 .I troff \" GNU
146 (or a
147 .I troff \" generic
148 implementing relevant GNU extensions)
149 must be used.
150 .
151 If no
152 .I file
153 operands are present,
154 or if
155 .I file
156 is
157 .RB \[lq] \- \[rq],
158 .I \%eqn
159 reads the standard input stream.
160 .
161 .
162 .P
163 Unless the
164 .B \-R
165 option is used,
166 .I \%eqn
167 searches for the file
168 .I eqnrc
169 in the directories given with the
170 .B \-M
171 option first,
172 then in
173 .if !'no'no' .IR /etc/\:\%groff/\:\%site\-tmac ,
174 .IR /etc/\:\%groff/\:\%site\-tmac ,
175 and finally in the standard macro directory
176 .IR /usr/\:\%share/\:\%groff/\:\%1.24.0/\:\%tmac .
177 .
178 If it exists and is readable,
179 .I \%eqn
180 processes it before any input.
181 .
182 .
183 .P
184 This man page primarily discusses the differences between GNU
185 .I eqn \" GNU
186 and AT&T
187 .IR eqn .\" AT&T
188 .
189 Most of the new features of the GNU
190 .I eqn \" GNU
191 input language are based on \*[tx].
192 .
193 There are some references to the differences between \*[tx] and GNU
194 .I eqn \" GNU
195 below;
196 these may safely be ignored if you do not know \*[tx].
197 .
198 Four points are worth note.
199 .
200 .
201 .IP \[bu] 3n
202 GNU
203 .I eqn \" GNU
204 emits Presentation MathML output when invoked with the
205 .RB \[lq] "\-T\~MathML" \[rq]
206 option.
207 .
208 .
209 .IP \[bu]
210 GNU
211 .I eqn \" GNU
212 does not support terminal devices well,
213 though it may suffice for simple inputs.
214 .
215 .
216 .IP \[bu]
217 GNU
218 .I eqn \" GNU
219 sets the input token
220 .RB \[lq] .\|.\|.\& \[rq]
221 as an ellipsis on the text baseline,
222 not the three centered dots of AT&T
223 .IR eqn . \" AT&T
224 .
225 Set an ellipsis on the math axis with the GNU extension macro
226 .BR cdots .
227 .
228 .
229 .IP \[bu]
230 GNU
231 .IR eqn 's\" GNU
232 .B delim
233 primitive does not treat an
234 .RB \[lq] on \[rq]
235 argument as a pair of equation delimiters.
236 .
237 .
238 .\" ====================================================================
239 .SS "Anatomy of an equation"
240 .\" ====================================================================
241 .
242 .I eqn
243 input consists of tokens.
244 .
245 Consider a form of Newton's second law of motion for constant mass.
246 .
247 The input
248 .
249 .
250 .P
251 .RS
252 .EX
253 \&.EQ
254 F =
255 m a
256 \&.EN
257 .EE
258 .RE
259 .
260 .
261 .P
262 becomes
263 .EQ
264 F =
265 m a.
266 .EN
267 .
268 Each of
269 .BR F ,
270 .BR = ,
271 .BR m ,
272 and
273 .B a
274 is a token.
275 .
276 .
277 Spaces and newlines are interchangeable;
278 they separate tokens but do not break lines or produce space in
279 the output.
280 .
281 .
282 .P
283 Beyond their primary functions,
284 the following input characters separate tokens as well.
285 .
286 .
287 .TP
288 .B "{ }"
289 Braces perform grouping.
290 .
291 Whereas
292 .RB \[lq] "e sup a b" \[rq]
293 expresses
294 .ie n .RI \[lq]( e "\~to the\~" a )\~times\~ b \[rq],
295 .el \{\
296 .EQ
297 e sup a b ,
298 .EN
299 .\}
300 .RB \[lq] "e sup { a b }" \[rq]
301 means
302 .ie n .RI \[lq] e "\~to the\~(" a \~times\~ b )\[rq].
303 .el \{\
304 .EQ
305 e sup { a b } .
306 .EN
307 .\}
308 .
309 When immediately preceded by a
310 .RB \[lq] left \[rq]
311 or
312 .RB \[lq] right \[rq]
313 primitive,
314 a brace loses its special meaning.
315 .
316 .
317 .TP
318 .B "\[ha] \[ti]
319 are the
320 .I "half space"
321 and
322 .I "full space,"
323 respectively.
324 .
325 Use them to tune the appearance of the output.
326 .
327 .
328 .P
329 Tab and leader characters separate tokens as well as advancing the
330 drawing position to the next tab stop,
331 but are seldom used in
332 .I eqn
333 input.
334 .
335 When they occur,
336 they must appear at the outermost lexical scope.
337 .
338 This roughly means that they can't appear within braces that are
339 necessary to disambiguate the input;
340 .I \%eqn
341 will diagnose an error in this event.
342 .
343 (See subsection \[lq]Macros\[rq] below for additional token separation
344 rules.)
345 .
346 .
347 .P
348 Other tokens are primitives,
349 macros,
350 an argument to either of the foregoing,
351 or components of an equation.
352 .
353 .
354 .br
355 .ne 4v
356 .P
357 .I Primitives
358 are fundamental keywords of the
359 .I eqn
360 language.
361 .
362 They can configure an aspect of the preprocessor's state,
363 as when setting a \[lq]global\[rq] font selection or type size
364 .RB ( gifont
365 and
366 .BR gsize ),
367 or declaring or deleting macros
368 .RB \%(\[lq] define \[rq]
369 and
370 .BR undef );
371 these are termed
372 .I commands.
373 .
374 Other primitives perform formatting operations on the tokens around them
375 (as with
376 .BR fat ,
377 .BR over ,
378 .BR sqrt ,
379 or
380 .BR up ).
381 .
382 .
383 .P
384 Equation
385 .I components
386 include mathematical variables,
387 constants,
388 numeric literals,
389 and operators.
390 .
391 .I \%eqn
392 remaps some input character sequences to
393 .I groff
394 special character escape sequences for economy in equation entry and to
395 ensure that glyphs from an unstyled font are used;
396 see
397 .MR groff_char 7 .
398 .
399 .
400 .P
401 .RS
402 .TS
403 tab(@);
404 Lf(CR) Lf(CR) Lw(1i) Lf(CR) Lf(CR).
405 +@\[rs][pl]@\&@\[aq]@\[rs][fm]
406 -@\[rs][mi]@\&@<=@\[rs][<=]
407 \&=@\[rs][eq]@\&@>=@\[rs][>=]
408 .TE
409 .RE
410 .
411 .
412 .P
413 .I Macros
414 permit primitives,
415 components,
416 and other macros to be collected and used together as a single token.
417 .
418 Predefined macros make convenient the preparation of
419 .I eqn
420 input in a form resembling its spoken expression;
421 for example,
422 consider
423 .BR cos ,
424 .BR hat ,
425 .BR inf ,
426 and
427 .BR lim .
428 .
429 .
430 .\" ====================================================================
431 .SS "Spacing and typeface"
432 .\" ====================================================================
433 .
434 GNU
435 .I eqn
436 imputes a type to each equation component,
437 adjusting the space around it accordingly.
438 .
439 Recognized types follow;
440 most affect spacing only,
441 whereas the
442 .RB \%\[lq] letter \[rq]
443 subtype of
444 .RB \%\[lq] ordinary \[rq]
445 also assigns a style.
446 .
447 .
448 .RS 2n \" we need quite a bit of horizontal space for this table
449 .P
450 .TS
451 Lf(CR) Lx
452 Af(CR) Lx
453 Af(CR) Lx
454 Lf(CR) Lx.
455 ordinary T{
456 character such as \[lq]1\[rq],
457 \[lq]a\[rq],
458 or
459 \[lq]!\&\[rq]
460 T}
461 letter character to be italicized by default
462 digit \f[I]n/a\f[]
463 operator T{
464 large operator such as
465 .ds Su \[lq]\s+5\[*S]\s0\[rq]
466 .if \n(.g .if !c\[*S] .ds Su the summation operator
467 \*[Su]
468 .rm Su
469 T}
470 binary binary operator such as \[lq]\[pl]\[rq]
471 relation relational operator such as \[lq]=\[rq]
472 opening opening bracket such as \[lq](\[rq]
473 closing closing bracket such as \[lq])\[rq]
474 punctuation punctuation character such as \[lq],\[rq]
475 inner sub-formula contained within brackets
476 suppress component to which automatic spacing is not applied
477 .TE
478 .RE
479 .
480 .
481 .P
482 Two primitives apply types to equation components.
483 .
484 .
485 .TP
486 .BI type\~ "t e"
487 Apply
488 .RI type\~ t
489 to
490 .RI expression\~ e .
491 .
492 .
493 .TP
494 .BI chartype\~ "t text"
495 Assign each character in (unquoted)
496 .I text
497 .RI type\~ t ,
498 persistently.
499 .
500 .
501 .P
502 .I \%eqn \" GNU
503 sets up spacings and styles as if by the following commands.
504 .
505 .P
506 .RS
507 .TS
508 tab(@);
509 Lf(CR)1 Lf(CR).
510 chartype \[dq]letter\[dq]@abcdefghiklmnopqrstuvwxyz
511 chartype \[dq]letter\[dq]@ABCDEFGHIKLMNOPQRSTUVWXYZ
512 chartype \[dq]letter\[dq]@\[rs][*a]\[rs][*b]\[rs][*g]\[rs][*d]\[rs][*e]\
513 \[rs][*z]
514 chartype \[dq]letter\[dq]@\[rs][*y]\[rs][*h]\[rs][*i]\[rs][*k]\[rs][*l]\
515 \[rs][*m]
516 chartype \[dq]letter\[dq]@\[rs][*n]\[rs][*c]\[rs][*o]\[rs][*p]\[rs][*r]\
517 \[rs][*s]
518 chartype \[dq]letter\[dq]@\[rs][*t]\[rs][*u]\[rs][*f]\[rs][*x]\[rs][*q]\
519 \[rs][*w]
520 chartype \[dq]binary\[dq]@*\[rs][pl]\[rs][mi]
521 chartype \[dq]relation\[dq]@<>\[rs][eq]\[rs][<=]\[rs][>=]
522 chartype \[dq]opening\[dq]@{([
523 chartype \[dq]closing\[dq]@})]
524 chartype \[dq]punctuation\[dq]@,;:.
525 chartype \[dq]suppress\[dq]@\[ha]\[ti]
526 .TE
527 .RE
528 .
529 .
530 .P
531 .I \%eqn
532 assigns all other ordinary and special
533 .I roff
534 characters,
535 including numerals 0\[en]9,
536 the
537 .RB \%\[lq] ordinary \[rq]
538 type.
539 .
540 (The
541 .RB \[lq] digit \[rq]
542 type is not used,
543 but is available for customization.)
544 .\" XXX: How would you actually customize it, though? There doesn't
545 .\" seem to be a means of replacing the font associated with a type.
546 .\" Is the "digit" type just cruft?
547 .
548 In keeping with common practice in mathematical typesetting,
549 lowercase,
550 but not uppercase,
551 Greek letters are assigned the
552 .RB \%\[lq] letter \[rq]
553 type to style them in italics.
554 .
555 The macros for producing ellipses,
556 .RB \[lq] .\|.\|. \[rq],
557 .BR cdots ,
558 and
559 .BR ldots ,
560 use the
561 .RB \%\[lq] inner \[rq]
562 type.
563 .
564 .
565 .\" ====================================================================
566 .SS Primitives
567 .\" ====================================================================
568 .
569 .I \%eqn
570 supports without alteration the AT&T
571 .I eqn \" AT&T
572 primitives
573 .BR above ,
574 .BR back ,
575 .BR bar ,
576 .BR bold ,
577 .BR \%define ,
578 .BR down ,
579 .BR fat ,
580 .BR font ,
581 .BR from ,
582 .BR fwd ,
583 .BR gfont ,
584 .BR gsize ,
585 .BR italic ,
586 .BR left ,
587 .BR lineup ,
588 .BR mark ,
589 .BR \%matrix ,
590 .BR \%ndefine ,
591 .BR over ,
592 .BR right ,
593 .BR roman ,
594 .BR size ,
595 .BR sqrt ,
596 .BR sub ,
597 .BR sup ,
598 .BR \%tdefine ,
599 .BR to ,
600 .BR \%under ,
601 and
602 .BR up .
603 .
604 .
605 .\" ====================================================================
606 .SS "New primitives"
607 .\" ====================================================================
608 .
609 We describe the GNU extension primitives
610 .RB \[lq] type \[rq]
611 and
612 .B \%chartype
613 in subsection \[lq]Spacing and typeface\[rq] above;
614 .RB \[lq] set \[rq]
615 and
616 .RB \[lq] reset \[rq]
617 in subsection \[lq]Customization\[rq] below;
618 and
619 .BR gbfont ,
620 .BR gifont ,
621 and
622 .B grfont
623 in subsection \[lq]Fonts\[rq] below.
624 .
625 In the following synopses,
626 .I X
627 can be any character not appearing in the parameter thus bracketed.
628 .
629 .
630 .TP
631 .IB e1 \~accent\~ e2
632 Set
633 .I e2
634 as an accent over
635 .IR e1 .
636 .
637 .I \%eqn
638 assumes that
639 .I e2
640 is at the appropriate height for a lowercase letter without an ascender,
641 and shifts it vertically based on
642 .IR e1 's
643 height.
644 .
645 For example,
646 .I \%eqn
647 defines
648 .B hat
649 as follows.
650 .
651 .
652 .RS
653 .IP
654 .EX
655 accent { roman "\[ha]" }
656 .EE
657 .RE
658 .
659 .
660 .IP
661 .BR dotdot ,
662 .BR dot ,
663 .BR tilde ,
664 .BR vec ,
665 and
666 .B dyad
667 are also defined using the
668 .B \%accent
669 primitive.
670 .
671 .
672 .TP
673 .BI big\~ e
674 Enlarge the expression
675 .IR e ;
676 semantics like those of CSS \[lq]large\[rq] are intended.
677 .
678 In
679 .I \%troff
680 output,
681 the type size is increased by\~5 scaled points.
682 .
683 MathML output emits the following.
684 .
685 .
686 .RS
687 .IP
688 .EX
689 <mstyle \%mathsize=\[aq]big\[aq]>
690 .EE
691 .RE
692 .
693 .
694 .TP
695 .BI copy\~ file
696 .TQ
697 .BI include\~ file
698 Interpolate the contents of
699 .IR file ,
700 omitting lines
701 beginning with
702 .B .EQ
703 or
704 .BR .EN .
705 .
706 .I file
707 is sought relative to the current working directory.
708 .
709 .
710 .TP
711 .BI ifdef\~ "name X anything X"
712 If
713 .I name
714 is defined as a primitive or macro,
715 interpret
716 .IR anything .
717 .
718 .
719 .TP
720 .BI nosplit\~ text
721 As
722 .RI \[dq] text \[dq],
723 but since
724 .I text
725 is not quoted it is subject to macro expansion;
726 it is not split up and the spacing between characters not adjusted per
727 subsection \[lq]Spacing and typeface\[rq] above.
728 .
729 .
730 .TP
731 .IB e\~ opprime
732 As
733 .BR prime ,
734 but set the prime symbol as an operator
735 .RI on\~ e .
736 .
737 In the input
738 .RB \[lq] "A opprime sub 1" \[rq],
739 the\~\[lq]1\[rq] is tucked under the prime as a subscript to
740 the\~\[lq]A\[rq]
741 (as is conventional in mathematical typesetting),
742 whereas when
743 .B prime
744 is used,
745 the\~\[lq]1\[rq] is a subscript to the prime character.
746 .
747 The precedence of
748 .B \%opprime
749 is the same as that of
750 .B bar
751 and
752 .RB \%\[lq] under \[rq],
753 and higher than that of other primitives except
754 .B \%accent
755 and
756 .BR uaccent .
757 .
758 In unquoted text,
759 a neutral apostrophe
760 .RB ( \[aq] )
761 that is not the first character on the input line is treated like
762 .BR \%opprime .
763 .
764 .
765 .TP
766 .BI sdefine\~ "name X anything X"
767 As
768 .RB \%\[lq] define \[rq],
769 but
770 .I name
771 is not recognized as a macro if called with arguments.
772 .
773 .
774 .TP
775 .IB e1 \~smallover\~ e2
776 As
777 .BR over ,
778 but reduce the type size of
779 .I e1
780 and
781 .IR e2 ,
782 and put less vertical space between
783 .I e1
784 and
785 .I e2
786 and the fraction bar.
787 .
788 The
789 .B over
790 primitive corresponds to the \*[tx]
791 .B \[rs]over
792 primitive in displayed equation styles;
793 .B smallover
794 corresponds to
795 .B \[rs]over
796 in non-display (\[lq]inline\[rq]) styles.
797 .
798 .
799 .br
800 .ne 5v
801 .TP
802 .BI space\~ n
803 Set extra vertical spacing around the equation,
804 replacing the default values,
805 where
806 .IR n \~is
807 an integer in hundredths of an em.
808 .
809 If positive,
810 .IR n \~increases
811 vertical spacing before the equation;
812 if negative,
813 it does so after the equation.
814 .
815 This primitive provides an interface to
816 .IR groff 's
817 .B \[rs]x
818 escape sequence,
819 but with the opposite sign convention.
820 .
821 It has no effect if the equation is part of a
822 .MR \%pic 1
823 picture.
824 .
825 .
826 .br
827 .ne 4v
828 .TP
829 .BI special\~ "troff-macro e"
830 Construct an object by calling
831 .I troff-macro
832 .RI on\~ e .
833 .
834 The
835 .I troff \" generic
836 string
837 .B 0s
838 contains the
839 .I eqn \" generic
840 output
841 .RI for\~ e ,
842 and the registers
843 .BR 0w ,
844 .BR 0h ,
845 .BR 0d ,
846 .BR 0skern ,
847 and
848 .B 0skew
849 the width,
850 height,
851 depth,
852 subscript kern,
853 and skew
854 .RI of\~ e ,
855 respectively.
856 .
857 (The
858 .I subscript kern
859 of an object indicates how much a subscript on that object should be
860 \[lq]tucked in\[rq],
861 or placed to the left relative to a non-subscripted glyph of the same
862 size.
863 .
864 The
865 .I skew
866 of an object is how far to the right of the center of the object an
867 accent over it should be placed.)
868 .
869 The macro must modify
870 .B 0s
871 so that it outputs the desired result,
872 returns the drawing position to the text baseline at the beginning of
873 .IR e ,
874 and updates the foregoing registers to correspond to the new dimensions
875 of the result.
876 .
877 .
878 .IP
879 Suppose you want a construct that \[lq]cancels\[rq] an expression by
880 drawing a diagonal line through it.
881 .
882 .
883 .br
884 .ne 11v
885 .RS
886 .IP
887 .EX
888 \&.de Ca
889 \&. ds 0s \[rs]
890 \[rs]Z\[aq]\[rs]\[rs]*(0s\[aq]\[rs]
891 \[rs]v\[aq]\[rs]\[rs]n(0du\[aq]\[rs]
892 \[rs]D\[aq]l \[rs]\[rs]n(0wu \-\[rs]\[rs]n(0hu\-\[rs]\
893 \[rs]n(0du\[aq]\[rs]
894 \[rs]v\[aq]\[rs]\[rs]n(0hu\[aq]
895 \&..
896 \&.EQ
897 special Ca "x \[rs][mi] 3 \[rs][pl] x" \[ti] 3
898 \&.EN
899 .EE
900 .RE
901 .
902 .
903 .IP
904 We use the
905 .B \[rs][mi]
906 and
907 .B \[rs][pl]
908 special characters instead of + and \-
909 because they are part of the argument to a
910 .I \%troff
911 macro,
912 so
913 .I \%eqn
914 does not transform them to mathematical glyphs for us.
915 .
916 Here's a more complicated construct that draws a box around an
917 expression;
918 the bottom of the box rests on the text baseline.
919 .
920 We define the
921 .I eqn \" generic
922 macro
923 .B box
924 to wrap the call of the
925 .I \%troff
926 macro
927 .BR Bx .
928 .
929 .
930 .br
931 .ne 17v
932 .RS
933 .IP
934 .EX
935 \&.de Bx
936 \&.ds 0s \[rs]
937 \[rs]Z\[aq]\[rs]\[rs]h\[aq]1n\[aq]\[rs]\[rs]*[0s]\[aq]\[rs]
938 \[rs]v\[aq]\[rs]\[rs]n(0du+1n\[aq]\[rs]
939 \[rs]D\[aq]l \[rs]\[rs]n(0wu+2n 0\[aq]\[rs]
940 \[rs]D\[aq]l 0 \-\[rs]\[rs]n(0hu\-\[rs]\[rs]n(0du\-2n\[aq]\[rs]
941 \[rs]D\[aq]l \-\[rs]\[rs]n(0wu\-2n 0\[aq]\[rs]
942 \[rs]D\[aq]l 0 \[rs]\[rs]n(0hu+\[rs]\[rs]n(0du+2n\[aq]\[rs]
943 \[rs]h\[aq]\[rs]\[rs]n(0wu+2n\[aq]
944 \&.nr 0w +2n
945 \&.nr 0d +1n
946 \&.nr 0h +1n
947 \&..
948 \&.EQ
949 define box \[aq] special Bx $1 \[aq]
950 box(foo) \[ti] "bar"
951 \&.EN
952 .EE
953 .RE
954 .
955 .
956 .TP
957 .BI "split \[dq]" text \[dq]
958 As
959 .IR text ,
960 but since
961 .I text
962 is quoted,
963 it is not subject to macro expansion;
964 it is split up and the spacing between characters adjusted per
965 subsection \[lq]Spacing and typeface\[rq] above.
966 .
967 .
968 .TP
969 .IB e1 \~uaccent\~ e2
970 Set
971 .I e2
972 as an accent under
973 .IR e1 .
974 .
975 .I e2
976 is assumed to be at the appropriate height for a letter without a
977 descender;
978 .I \% eqn
979 vertically shifts it depending on whether
980 .I e1
981 has a descender.
982 .
983 .B utilde
984 is predefined using
985 .B uaccent
986 as a tilde accent below the baseline.
987 .
988 .
989 .TP
990 .BI undef\~ name
991 Remove definition of macro or primitive
992 .IR name ,
993 making it undefined.
994 .
995 .
996 .TP
997 .BI vcenter\~ e
998 Vertically center
999 .I e
1000 about the
1001 .IR "math axis" ,
1002 a horizontal line upon which fraction bars and characters such as
1003 \[lq]\[pl]\[rq] and \[lq]\[mi]\[rq] are aligned.
1004 .
1005 MathML already behaves this way,
1006 so
1007 .I \%eqn
1008 ignores this primitive when producing that output format.
1009 .
1010 The built-in
1011 .B sum
1012 macro is defined as if by the following.
1013 .
1014 .RS
1015 .IP
1016 .EX
1017 define sum ! { type "operator" vcenter size +5 \[rs](*S } !
1018 .EE
1019 .RE
1020 .
1021 .
1022 .br
1023 .ne 8v
1024 .\" ====================================================================
1025 .SS "Extended primitives"
1026 .\" ====================================================================
1027 .
1028 GNU
1029 .I eqn \" GNU
1030 extends the syntax of some AT&T
1031 .I eqn \" AT&T
1032 primitives,
1033 introducing one deliberate incompatibility.
1034 .
1035 .
1036 .TP
1037 .B "delim on"
1038 GNU
1039 .I eqn \" GNU
1040 recognizes an
1041 .RB \[lq] on \[rq]
1042 argument to the
1043 .B \%delim
1044 primitive specially,
1045 restoring any delimiters previously disabled with
1046 .RB \%\[lq] "delim off" \[rq].
1047 .
1048 If delimiters haven't been specified,
1049 neither command has effect.
1050 .
1051 Few
1052 .I eqn \" generic
1053 documents are expected to use \[lq]o\[rq] and \[lq]n\[rq] as left and
1054 right delimiters,
1055 respectively.
1056 .
1057 If yours does,
1058 swap them,
1059 or select others.
1060 .
1061 .
1062 .TP
1063 .BI col\~ n\~\c
1064 .BR {\~ .\|.\|.\& \~}
1065 .TQ
1066 .BI ccol\~ n\~\c
1067 .BR {\~ .\|.\|.\& \~}
1068 .TQ
1069 .BI lcol\~ n\~\c
1070 .BR {\~ .\|.\|.\& \~}
1071 .TQ
1072 .BI rcol\~ n\~\c
1073 .BR {\~ .\|.\|.\& \~}
1074 .TQ
1075 .BI pile\~ n\~\c
1076 .BR {\~ .\|.\|.\& \~}
1077 .TQ
1078 .BI cpile\~ n\~\c
1079 .BR {\~ .\|.\|.\& \~}
1080 .TQ
1081 .BI lpile\~ n\~\c
1082 .BR {\~ .\|.\|.\& \~}
1083 .TQ
1084 .BI rpile\~ n\~\c
1085 .BR {\~ .\|.\|.\& \~}
1086 The integer
1087 .RI value\~ n ,
1088 in hundredths of an em,
1089 uses the formatter's
1090 .B \[rs]x
1091 escape sequence to increase the vertical spacing between rows;
1092 .I \%eqn
1093 ignores it when producing MathML.
1094 .
1095 Negative values are accepted but have no effect.
1096 .
1097 If more than one
1098 .I n
1099 occurs in a matrix or pile,
1100 the largest is used.
1101 .
1102 .
1103 .\" ====================================================================
1104 .SS Customization
1105 .\" ====================================================================
1106 .
1107 When
1108 .I \%eqn
1109 generates
1110 .I \%troff
1111 input,
1112 the appearance of equations is controlled by a large number of
1113 parameters.
1114 .
1115 They have no effect when generating MathML,
1116 which delegates typesetting to a MathML rendering engine.
1117 .
1118 Configure these parameters with the
1119 .RB \[lq] set \[rq]
1120 and
1121 .RB \[lq] reset \[rq]
1122 primitives.
1123 .
1124 .
1125 .TP 9n \" "set p n" + 2n
1126 .BI set\~ "p n"
1127 assigns
1128 .RI parameter\~ p
1129 the integer
1130 .RI value\~ n ;
1131 .IR n \~is
1132 interpreted in units of hundredths of an em unless otherwise stated.
1133 For example,
1134 .
1135 .RS
1136 .RS
1137 .EX
1138 set x_height 45
1139 .EE
1140 .RE
1141 .
1142 says that
1143 .I \%eqn
1144 should assume that the font's x-height is 0.45\~ems.
1145 .RE
1146 .
1147 .
1148 .TP
1149 .BI reset\~ p
1150 restores the default value of
1151 .RI parameter\~ p.
1152 .
1153 .
1154 .P
1155 Available parameters
1156 .I p
1157 are as follows;
1158 defaults are shown in parentheses.
1159 .
1160 We intend these descriptions to be expository rather than rigorous.
1161 .
1162 .
1163 .TP 24n \" "default_rule_thickness" + 2n
1164 .B minimum_size
1165 sets a floor for the type size
1166 (in scaled points)
1167 at which equations are set
1168 .RB ( 5 ).
1169 .
1170 .
1171 .TP
1172 .B fat_offset
1173 The
1174 .B fat
1175 primitive emboldens an equation by overprinting two copies of the
1176 equation horizontally offset by this amount
1177 .RB ( 4 ).
1178 .
1179 When producing MathML output,
1180 components to which
1181 .B \%fat_offset
1182 applies instead use the following.
1183 .
1184 .RS
1185 .RS
1186 .EX
1187 <mstyle mathvariant=\[aq]double\-struck\[aq]>
1188 .EE
1189 .RE
1190 .RE
1191 .
1192 .
1193 .TP
1194 .B over_hang
1195 A fraction bar is longer by twice this amount than
1196 the maximum of the widths of the numerator and denominator;
1197 in other words,
1198 it overhangs the numerator and denominator by at least this amount
1199 .RB ( 0 ).
1200 .
1201 .
1202 .TP
1203 .B accent_width
1204 When
1205 .B bar
1206 or
1207 .B \%under
1208 is applied to a single character,
1209 the line is this long
1210 .RB ( 31 ).
1211 .
1212 Normally,
1213 .B bar
1214 or
1215 .B \%under
1216 produces a line whose length is the width of the object to which it
1217 applies;
1218 in the case of a single character,
1219 this tends to produce a line that looks too long.
1220 .
1221 .
1222 .TP
1223 .B delimiter_factor
1224 Extensible delimiters produced with the
1225 .B left
1226 and
1227 .B right
1228 primitives have a combined height and depth of at least this many
1229 thousandths of twice the maximum amount by which the sub-equation that
1230 the delimiters enclose extends away from the axis
1231 .RB ( 900 ).
1232 .
1233 .
1234 .TP
1235 .B delimiter_shortfall
1236 Extensible delimiters produced with the
1237 .B left
1238 and
1239 .B right
1240 primitives have a combined height and depth not less than the
1241 difference of twice the maximum amount by which the sub-equation that
1242 the delimiters enclose extends away from the axis and this amount
1243 .RB ( 50 ).
1244 .
1245 .
1246 .TP
1247 .B null_delimiter_space
1248 This much horizontal space is inserted on each side of a fraction
1249 .RB ( 12 ).
1250 .
1251 .
1252 .TP
1253 .B script_space
1254 The width of subscripts and superscripts is increased by this amount
1255 .RB ( 5 ).
1256 .
1257 .
1258 .TP
1259 .B thin_space
1260 This amount of space is automatically inserted after punctuation
1261 characters
1262 .RB ( 17 ).
1263 .
1264 .
1265 .TP
1266 .B medium_space
1267 This amount of space is automatically inserted on either side of
1268 binary operators
1269 .RB ( 22 ).
1270 .
1271 .
1272 .TP
1273 .B thick_space
1274 This amount of space is automatically inserted on either side of
1275 relations
1276 .RB ( 28 ).
1277 .
1278 .
1279 .TP
1280 .B half_space
1281 configures the width of the space produced by the
1282 .B \[ha]
1283 token
1284 .RB ( 17 ).
1285 .
1286 .
1287 .TP
1288 .B full_space
1289 configures the width of the space produced by the
1290 .B \[ti]
1291 token
1292 .RB ( 28 ).
1293 .
1294 .
1295 .TP
1296 .B x_height
1297 The height of lowercase letters without ascenders such as \[lq]x\[rq]
1298 .RB ( 45 ).
1299 .
1300 .
1301 .TP
1302 .B axis_height
1303 The height above the baseline of the center of characters such as
1304 \[lq]\[pl]\[rq] and \[lq]\[mi]\[rq]
1305 .RB ( 26 ).
1306 .
1307 It is important that this value is correct for the font
1308 you are using.
1309 .
1310 .
1311 .TP
1312 .B default_rule_thickness
1313 This should be set to the thickness of the
1314 .B \[rs][ru]
1315 character,
1316 or the thickness of horizontal lines produced with the
1317 .B \[rs]D
1318 escape sequence
1319 .RB ( 4 ).
1320 .
1321 .
1322 .TP
1323 .B num1
1324 The
1325 .B over
1326 primitive shifts up the numerator by at least this amount
1327 .RB ( 70 ).
1328 .
1329 .
1330 .TP
1331 .B num2
1332 The
1333 .B smallover
1334 primitive shifts up the numerator by at least this amount
1335 .RB ( 36 ).
1336 .
1337 .
1338 .TP
1339 .B denom1
1340 The
1341 .B over
1342 primitive shifts down the denominator by at least this amount
1343 .RB ( 70 ).
1344 .
1345 .
1346 .TP
1347 .B denom2
1348 The
1349 .B smallover
1350 primitive shifts down the denominator by at least this amount
1351 .RB ( 36 ).
1352 .
1353 .
1354 .TP
1355 .B sup1
1356 Normally superscripts are shifted up by at least this amount
1357 .RB ( 42 ).
1358 .
1359 .
1360 .TP
1361 .B sup2
1362 Superscripts within superscripts or upper limits
1363 or numerators of
1364 .B smallover
1365 fractions are shifted up by at least this amount
1366 .RB ( 37 ).
1367 .
1368 Conventionally,
1369 this is less than
1370 .BR sup1 .
1371 .
1372 .
1373 .TP
1374 .B sup3
1375 Superscripts within denominators or square roots
1376 or subscripts or lower limits are shifted up by at least
1377 this amount
1378 .RB ( 28 ).
1379 .
1380 Conventionally,
1381 this is less than
1382 .BR sup2 .
1383 .
1384 .
1385 .TP
1386 .B sub1
1387 Subscripts are normally shifted down by at least this amount
1388 .RB ( 20 ).
1389 .
1390 .
1391 .TP
1392 .B sub2
1393 When there is both a subscript and a superscript,
1394 the subscript is shifted down by at least this amount
1395 .RB ( 23 ).
1396 .
1397 .
1398 .TP
1399 .B sup_drop
1400 The baseline of a superscript is no more than this much below the top of
1401 the object on which the superscript is set
1402 .RB ( 38 ).
1403 .
1404 .
1405 .TP
1406 .B sub_drop
1407 The baseline of a subscript is at least this much below the bottom of
1408 the object on which the subscript is set
1409 .RB ( 5 ).
1410 .
1411 .
1412 .TP
1413 .B big_op_spacing1
1414 The baseline of an upper limit is at least this much above the top of
1415 the object on which the limit is set
1416 .RB ( 11 ).
1417 .
1418 .
1419 .TP
1420 .B big_op_spacing2
1421 The baseline of a lower limit is at least this much below the bottom
1422 of the object on which the limit is set
1423 .RB ( 17 ).
1424 .
1425 .
1426 .TP
1427 .B big_op_spacing3
1428 The bottom of an upper limit is at least this much above the top of
1429 the object on which the limit is set
1430 .RB ( 20 ).
1431 .
1432 .
1433 .TP
1434 .B big_op_spacing4
1435 The top of a lower limit is at least this much below the bottom of the
1436 object on which the limit is set
1437 .RB ( 60 ).
1438 .
1439 .
1440 .TP
1441 .B big_op_spacing5
1442 This much vertical space is added above and below limits
1443 .RB ( 10 ).
1444 .
1445 .
1446 .TP
1447 .B baseline_sep
1448 The baselines of the rows in a pile or matrix are normally this far
1449 apart
1450 .RB ( 140 ).
1451 .
1452 Usually equal to the sum of
1453 .B num1
1454 and
1455 .BR denom1 .
1456 .
1457 .
1458 .TP
1459 .B shift_down
1460 The midpoint between the top baseline and the bottom baseline in a
1461 matrix or pile is shifted down by this much from the axis
1462 .RB ( 26 ).
1463 .
1464 Usually equal to
1465 .BR axis_height .
1466 .
1467 .
1468 .TP
1469 .B column_sep
1470 This much space is added between columns in a matrix
1471 .RB ( 100 ).
1472 .
1473 .
1474 .TP
1475 .B matrix_side_sep
1476 This much space is added at each side of a matrix
1477 .RB ( 17 ).
1478 .
1479 .
1480 .br
1481 .ne 4v
1482 .TP
1483 .B draw_lines
1484 If non-zero,
1485 .I \%eqn
1486 draws lines using the
1487 .I troff \" generic
1488 .B \[rs]D
1489 escape sequence,
1490 rather than the
1491 .B \[rs]l
1492 escape sequence and the
1493 .B \[rs][ru]
1494 special character.
1495 .
1496 The
1497 .I eqnrc
1498 file sets the default:
1499 .BR 1 \~on
1500 .BR ps ,
1501 .BR html ,
1502 and the X11 devices,
1503 .RB otherwise\~ 0 .
1504 .
1505 .
1506 .TP
1507 .B body_height
1508 is the presumed height of an equation above the text baseline;
1509 .I \%eqn
1510 adds any excess as extra pre-vertical line spacing with
1511 .IR troff 's\" generic
1512 .B \[rs]x
1513 escape sequence
1514 .RB ( 85 ).
1515 .
1516 .
1517 .TP
1518 .B body_depth
1519 is the presumed depth of an equation below the text baseline;
1520 .I \%eqn
1521 adds any excess as extra post-vertical line spacing with
1522 .IR troff 's\" generic
1523 .B \[rs]x
1524 escape sequence
1525 .RB ( 35 ).
1526 .
1527 .
1528 .TP
1529 .B nroff
1530 If non-zero,
1531 then
1532 .B \%ndefine
1533 behaves like
1534 .B \%define
1535 and
1536 .B \%tdefine
1537 is ignored,
1538 otherwise
1539 .B \%tdefine
1540 behaves like
1541 .B \%define
1542 and
1543 .B \%ndefine
1544 is ignored.
1545 .
1546 The
1547 .I eqnrc
1548 file sets the default:
1549 .BR 1 \~on
1550 .BR ascii ,
1551 .BR latin1 ,
1552 and
1553 .B utf8
1554 devices,
1555 .RB otherwise\~ 0 .
1556 .
1557 .
1558 .\" ====================================================================
1559 .SS Macros
1560 .\" ====================================================================
1561 .
1562 In GNU
1563 .IR eqn , \" GNU
1564 macros can take arguments.
1565 .
1566 A word defined by any of the
1567 .BR \%define ,
1568 .BR \%ndefine ,
1569 or
1570 .B \%tdefine
1571 primitives followed immediately by a left parenthesis is treated as a
1572 .I "parameterized macro call:"
1573 subsequent tokens up to a matching right parenthesis are treated as
1574 comma-separated arguments.
1575 .
1576 In this context only,
1577 commas and parentheses also serve as token separators.
1578 .
1579 A macro argument is not terminated by a comma inside parentheses nested
1580 within it.
1581 .
1582 In a macro definition,
1583 .BI $ n\c
1584 ,
1585 where
1586 .I n
1587 is between 1 and\~9 inclusive,
1588 is replaced by the
1589 .IR n th
1590 argument;
1591 if there are fewer than
1592 .IR n \~arguments,
1593 it is replaced by nothing.
1594 .
1595 .
1596 .\" ====================================================================
1597 .SS "Predefined macros"
1598 .\" ====================================================================
1599 .
1600 GNU
1601 .I eqn \" GNU
1602 supports the predefined macros offered by AT&T
1603 .IR eqn : \" AT&T
1604 .BR and ,
1605 .BR \%approx ,
1606 .BR arc ,
1607 .BR cos ,
1608 .BR cosh ,
1609 .BR del ,
1610 .BR det ,
1611 .BR dot ,
1612 .BR \%dotdot ,
1613 .BR dyad ,
1614 .BR exp ,
1615 .BR for ,
1616 .BR grad ,
1617 .BR half ,
1618 .BR hat ,
1619 .BR if ,
1620 .BR \%inter ,
1621 .BR Im ,
1622 .BR inf ,
1623 .BR int ,
1624 .BR lim ,
1625 .BR ln ,
1626 .BR log ,
1627 .BR max ,
1628 .BR min ,
1629 .BR \%nothing ,
1630 .BR \%partial ,
1631 .BR prime ,
1632 .BR prod ,
1633 .BR Re ,
1634 .BR sin ,
1635 .BR sinh ,
1636 .BR sum ,
1637 .BR tan ,
1638 .BR tanh ,
1639 .BR tilde ,
1640 .BR times ,
1641 .BR union ,
1642 .BR vec ,
1643 .BR == ,
1644 .BR != ,
1645 .BR += ,
1646 .BR \-> ,
1647 .BR <\- ,
1648 .BR << ,
1649 .BR >> ,
1650 and
1651 .RB \[lq] .\|.\|. \[rq].
1652 .
1653 The lowercase classical Greek letters are available as
1654 .BR \%alpha ,
1655 .BR beta ,
1656 .BR chi ,
1657 .BR delta ,
1658 .BR \%epsilon ,
1659 .BR eta ,
1660 .BR gamma ,
1661 .BR iota ,
1662 .BR kappa ,
1663 .BR lambda ,
1664 .BR mu ,
1665 .BR nu ,
1666 .BR omega ,
1667 .BR \%omicron ,
1668 .BR phi ,
1669 .BR pi ,
1670 .BR psi ,
1671 .BR rho ,
1672 .BR sigma ,
1673 .BR tau ,
1674 .BR theta ,
1675 .BR \%upsilon ,
1676 .BR xi ,
1677 and
1678 .BR zeta .
1679 .
1680 Spell them with an initial capital letter
1681 .RB \%( Alpha )
1682 or in full capitals
1683 .RB \%( ALPHA )
1684 to obtain uppercase forms.
1685 .
1686 .
1687 .P
1688 GNU
1689 .I eqn \" GNU
1690 further defines the macros
1691 .BR cdot ,
1692 .BR cdots ,
1693 and
1694 .B utilde
1695 (all discussed above),
1696 .BR \%dollar ,
1697 which sets a dollar sign,
1698 and
1699 .BR ldots ,
1700 which sets an ellipsis on the text baseline.
1701 .
1702 .
1703 .\" ====================================================================
1704 .SS Fonts
1705 .\" ====================================================================
1706 .
1707 .I \%eqn
1708 uses up to three typefaces to set an equation:
1709 italic (oblique),
1710 roman (upright),
1711 and bold (heavy).
1712 .
1713 Assign each a
1714 .I groff
1715 typeface with the GNU extension primitives
1716 .BR \%grfont ,
1717 .BR \%gifont ,
1718 and
1719 .B \%gbfont.
1720 .
1721 The defaults are the styles
1722 .BR R ,
1723 .BR I ,
1724 and
1725 .B B
1726 (applied to the current font family).
1727 .
1728 The
1729 .B \%chartype
1730 primitive
1731 (see above)
1732 sets a character's type,
1733 which determines the face used to set it.
1734 .
1735 The
1736 .RB \%\[lq] letter \[rq]
1737 type is set in italics;
1738 others are set in roman.
1739 .
1740 Use the
1741 .B bold
1742 primitive to select an (upright) bold style.
1743 .
1744 .
1745 .TP
1746 .BI gbfont\~ f
1747 .RI Select\~ f
1748 as the bold font.
1749 .
1750 .
1751 .TP
1752 .BI gifont\~ f
1753 .RI Select\~ f
1754 as the italic font.
1755 .
1756 GNU
1757 .I eqn \" GNU
1758 recognizes
1759 .B gfont
1760 as a synonym for
1761 AT&T compatibility.
1762 .
1763 .
1764 .TP
1765 .BI grfont\~ f
1766 .RI Select\~ f
1767 as the roman font.
1768 .
1769 .
1770 .br
1771 .ne 6v
1772 .\" ====================================================================
1773 .SH Options
1774 .\" ====================================================================
1775 .
1776 .B \-\-help
1777 displays a usage message,
1778 while
1779 .B \-v
1780 and
1781 .B \%\-\-version
1782 show version information;
1783 all exit afterward.
1784 .
1785 .
1786 .TP 8.125n \" "-M dir" + 2n + hand-tuned for PDF
1787 .B \-C
1788 Recognize
1789 .B .EQ
1790 and
1791 .B .EN
1792 even when followed by a character other than space or newline.
1793 .
1794 .
1795 .TP
1796 .BI \-d\~ xy
1797 Specify delimiters
1798 .I x
1799 for left
1800 .RI and\~ y
1801 for right ends
1802 of equations not bracketed by
1803 .BR .EQ / .EN .
1804 .
1805 .I x
1806 and
1807 .I y
1808 need not be distinct.
1809 .
1810 Any
1811 .RB \%\[lq] delim
1812 .IR xy \[rq]
1813 statements in the source file override this option.
1814 .
1815 .
1816 .TP
1817 .BI \-f\~ F
1818 is equivalent to
1819 .RB \[lq] gifont
1820 .IR F \[rq].
1821 .
1822 .
1823 .TP
1824 .BI \-m\~ n
1825 is equivalent to
1826 .RB \[lq] "set \%minimum_size"
1827 .IR n \[rq].
1828 .
1829 .
1830 .TP
1831 .BI \-M\~ dir
1832 Search
1833 .I dir
1834 for
1835 .I eqnrc
1836 before those listed in section \[lq]Description\[rq] above.
1837 .
1838 .
1839 .TP
1840 .B \-N
1841 Prohibit newlines within delimiters,
1842 allowing
1843 .I \%eqn
1844 to recover better from missing closing delimiters.
1845 .
1846 .
1847 .TP
1848 .BI \-p\~ n
1849 Set sub- and superscripts
1850 .IR n \~points
1851 smaller than the surrounding text.
1852 .
1853 This option is deprecated.
1854 .
1855 .I \%eqn
1856 normally sets sub- and superscripts at 70% of the type size of the
1857 surrounding text.
1858 .
1859 .
1860 .TP
1861 .B \-r
1862 Reduce the type size of super- and subscripts at most once relative to
1863 the base type size.
1864 .
1865 .
1866 .TP
1867 .B \-R
1868 Don't load
1869 .IR eqnrc .
1870 .
1871 .
1872 .TP
1873 .BI \-s\~ n
1874 is equivalent to
1875 .RB \[lq] gsize
1876 .IR n \[rq].
1877 .
1878 This option is deprecated.
1879 .
1880 .
1881 .TP
1882 .BI \-T\~ dev
1883 Prepare output for the device
1884 .IR dev .
1885 .
1886 This option
1887 defines a macro
1888 .I dev
1889 with the
1890 .RB value\~ 1 ;
1891 .I eqnrc
1892 thereby provides definitions appropriate to the device.
1893 .
1894 However,
1895 if
1896 .I dev
1897 is
1898 .RB \[lq] MathML \[rq],
1899 .I \%eqn
1900 produces output in that language rather than
1901 .IR roff ,
1902 and does not load
1903 .IR eqnrc .
1904 .\" XXX: why NOT load eqnrc?
1905 .
1906 The default device is
1907 .BR \%ps .
1908 .
1909 .
1910 .\" ====================================================================
1911 .SH "Exit status"
1912 .\" ====================================================================
1913 .
1914 .I \%eqn
1915 exits with
1916 .RB status\~ 0
1917 on successful operation,
1918 .RB status\~ 2
1919 if the program cannot interpret its command-line arguments,
1920 and
1921 .RB status\~ 1
1922 if it encounters an error during operation.
1923 .
1924 .
1925 .\" ====================================================================
1926 .SH Files
1927 .\" ====================================================================
1928 .
1929 .TP
1930 .I /usr/\:\%share/\:\%groff/\:\%1.24.0/\:\%tmac/\:\%eqnrc
1931 initializes the preprocessor for
1932 .I \%troff
1933 output.
1934 .
1935 Any valid
1936 .I \%eqn
1937 input is accepted.
1938 .
1939 .
1940 .\" ====================================================================
1941 .SH "MathML output limitations"
1942 .\" ====================================================================
1943 .
1944 MathML's design assumes that it cannot know the exact physical
1945 characteristics of the media and devices on which it will be rendered.
1946 .
1947 It does not support control of motions and sizes to the same
1948 degree
1949 .I \%troff
1950 does.
1951 .
1952 .
1953 .IP \[bu] 3n
1954 GNU
1955 .IR eqn 's\" GNU
1956 rendering parameters
1957 (see section \[lq]Customziation\[rq] above)
1958 have no effect on generated MathML.
1959 .
1960 .
1961 .IP \[bu]
1962 The
1963 .BR \%special ,
1964 .BR up ,
1965 .BR down ,
1966 .BR fwd ,
1967 and
1968 .B back
1969 primitives cannot be implemented,
1970 and yield a MathML \%\[lq]<merror>\[rq] message instead.
1971 .
1972 .
1973 .IP \[bu]
1974 The
1975 .B vcenter
1976 primitive is silently ignored,
1977 as centering on the math axis is the MathML default.
1978 .
1979 .
1980 .IP \[bu]
1981 Characters that
1982 .I \%eqn
1983 sets extra large in
1984 .I troff \" output format
1985 output\[em]notably the integral sign\[em]may appear too small
1986 and need to have their \[lq]<mstyle>\[rq] wrappers adjusted by hand.
1987 .
1988 .
1989 .P
1990 As when producing
1991 .I troff \" output format
1992 output,
1993 .I \%eqn
1994 generates MathML that leaves the
1995 .B .EQ
1996 and
1997 .B .EN
1998 tokens in place,
1999 but emits nothing corresponding to
2000 .B \%delim
2001 delimiters.
2002 .
2003 They can,
2004 however,
2005 be recognized as character sequences that begin with \[lq]<math>\[rq],
2006 end with \[lq]</math>\[rq],
2007 and do not cross line boundaries.
2008 .
2009 .
2010 .\" ====================================================================
2011 .SH Caveats
2012 .\" ====================================================================
2013 .
2014 Tokens must be double-quoted in
2015 .I eqn \" generic
2016 input if they are not to be recognized as names of macros or primitives,
2017 or if they are to be interpreted by
2018 .IR troff . \" generic
2019 .
2020 In particular,
2021 short ones,
2022 like
2023 .RB \[lq] pi \[rq]
2024 and
2025 .RB \[lq] PI \[rq],
2026 can collide with
2027 .I troff \" generic
2028 identifiers.
2029 .
2030 For instance,
2031 the
2032 .I eqn \" generic
2033 command
2034 .RB \%\[lq]\^ "gifont PI" \^\[rq]
2035 does not select the
2036 .MR gropdf 1
2037 or
2038 .MR grops 1
2039 device's Palatino italic font as the global italic face;
2040 you must use
2041 .RB \%\[lq]\^ "gifont \[dq]PI\[dq]" \^\[rq]
2042 instead.
2043 .
2044 .
2045 .P
2046 Delimited equations are set at the type size current at the beginning of
2047 the input line,
2048 not necessarily that immediately preceding the opening delimiter.
2049 .
2050 .
2051 .P
2052 Unlike \*[tx],
2053 .I eqn \" generic
2054 does not inherently distinguish displayed and inline equation styles;
2055 see the
2056 .B smallover
2057 primitive above.
2058 .
2059 However,
2060 macro packages frequently define
2061 .B EQ
2062 and
2063 .B EN
2064 macros such that the equation within is displayed.
2065 .
2066 These macros may accept arguments permitting the equation to be labeled
2067 or captioned;
2068 see the package's documentation.
2069 .
2070 .
2071 .\" ====================================================================
2072 .SH Bugs
2073 .\" ====================================================================
2074 .
2075 .I eqn \" generic
2076 abuses terminology\[em]its
2077 \[lq]equations\[rq]
2078 can be inequalities,
2079 bare expressions,
2080 or unintelligible gibberish.
2081 .
2082 But there's no changing it now.
2083 .
2084 .
2085 .P
2086 When producing terminal output,
2087 GNU
2088 .I eqn \" GNU
2089 renders lowercase Greek letters in roman instead of italic style.
2090 .
2091 .
2092 .P
2093 When producing MathML output,
2094 the
2095 .B mark
2096 and
2097 .B lineup
2098 features don't work.
2099 .
2100 These could,
2101 in theory,
2102 be implemented with \%\[lq]<maligngroup>\[rq] elements.
2103 .
2104 .
2105 .P
2106 When producing MathML output,
2107 each digit of a numeric literal gets a separate \[lq]<mn>\:</mn>\[rq]
2108 pair,
2109 and decimal points are tagged with \[lq]<mo>\:</mo>\[rq].
2110 .
2111 This is allowed by the specification,
2112 but inefficient.
2113 .
2114 .
2115 .\" ====================================================================
2116 .SH Examples
2117 .\" ====================================================================
2118 .
2119 We first illustrate
2120 .I \%eqn
2121 usage with a trigonometric identity.
2122 .
2123 .
2124 .RS
2125 .P
2126 .EX
2127 \&.EQ
2128 sin ( alpha + beta ) = sin alpha cos beta + cos alpha sin beta
2129 \&.EN
2130 .EE
2131 .if t \{\
2132 .
2133 .
2134 .P
2135 .RS
2136 .EQ
2137 sin ( alpha + beta ) = sin alpha cos beta + cos alpha sin beta
2138 .EN
2139 .RE
2140 .\}
2141 .RE
2142 .
2143 .
2144 .P
2145 It can be convenient to set up delimiters if mathematical content will
2146 appear frequently in running text.
2147 .
2148 .
2149 .RS
2150 .P
2151 .EX
2152 \&.EQ
2153 delim $$
2154 \&.EN
2155 .
2156 Having cached a table of logarithms,
2157 the property $ln ( x y ) = ln x + ln y$ sped calculations.
2158 .EE
2159 .if t \{\
2160 .
2161 .
2162 .P
2163 .RS
2164 .EQ
2165 delim $$
2166 .EN
2167 .
2168 Having cached a table of logarithms,
2169 the property $ln ( x y ) = ln x + ln y$ sped calculations.
2170 .
2171 .\" We _must_ shut delimiters back off when serially processing man
2172 .\" pages, or subsequent documents cannot safely use those characters.
2173 .EQ
2174 delim off
2175 .EN
2176 .RE
2177 .\}
2178 .RE
2179 .
2180 .
2181 .P
2182 The quadratic formula affords an opportunity to use fractions,
2183 radicals,
2184 and the full space token
2185 .BR \[ti] .
2186 .
2187 .
2188 .RS
2189 .P
2190 .EX
2191 \&.EQ
2192 x = { \- b \[ti] \[rs][+\-] \[ti] sqrt { b sup 2 \- 4 a c } } \
2193 over { 2 a }
2194 \&.EN
2195 .EE
2196 .if t \{\
2197 .
2198 .
2199 .P
2200 .RS
2201 .EQ
2202 x = { - b ~ \[+-] ~ sqrt { b sup 2 - 4 a c } } over { 2 a }
2203 .EN
2204 .RE
2205 .\}
2206 .RE
2207 .
2208 .
2209 .P
2210 Alternatively,
2211 we could define the plus-minus sign as a binary operator.
2212 .
2213 Automatic spacing puts 0.06\~em less space on either side of the
2214 plus-minus than \[ti] does,
2215 this being the difference between the widths of the
2216 .B medium_space
2217 parameter used by binary operators and that of the full space.
2218 .
2219 Independently,
2220 we can define a macro \[lq]frac\[rq] for setting fractions.
2221 .
2222 .
2223 .br
2224 .ne 5v
2225 .RS
2226 .P
2227 .EX
2228 \&.EQ
2229 chartype "binary" \[rs][+\-]
2230 define frac ! { $1 } over { $2 } !
2231 x = frac(\- b \[rs][+\-] sqrt { b sup 2 \- 4 a c }, 2 a)
2232 \&.EN
2233 .EE
2234 .if t \{\
2235 .
2236 .
2237 .P
2238 .RS
2239 .EQ
2240 chartype "binary" \[+-]
2241 define frac ! { $1 } over { $2 } !
2242 x = frac(- b \[+-] sqrt { b sup 2 - 4 a c }, 2 a)
2243 .EN
2244 .RE
2245 .\}
2246 .RE
2247 .
2248 .
2249 .\" ====================================================================
2250 .SH "See also"
2251 .\" ====================================================================
2252 .
2253 \[lq]Typesetting Mathematics\[em]User's Guide\[rq]
2254 (2nd edition),
2255 by Brian W.\& Kernighan
2256 and Lorinda L.\& Cherry,
2257 1978,
2258 AT&T Bell Laboratories Computing Science Technical Report No.\& 17.
2259 .
2260 .
2261 .P
2262 .IR The\~\*[tx]book ,
2263 by Donald E.\& Knuth,
2264 1984,
2265 Addison-Wesley Professional.
2266 .
2267 Appendix\~G
2268 discusses many of the parameters from section \[lq]Customization\[rq]
2269 above in greater detail.
2270 .
2271 .
2272 .P
2273 .MR groff_char 7
2274 documents a variety of special character escape sequences useful in
2275 mathematical typesetting.
2276 .
2277 See subsections \[lq]Logical symbols\[rq],
2278 \[lq]Mathematical symbols\[rq],
2279 and \[lq]Greek glyphs\[rq] in particular.
2280 .
2281 .
2282 .P
2283 .MR groff 1 ,
2284 .MR \%troff 1 ,
2285 .MR \%pic 1 ,
2286 .MR groff_font 5
2287 .
2288 .
2289 .\" Clean up.
2290 .rm tx
2291 .
2292 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
2293 .cp \n[*groff_eqn_1_man_C]
2294 .do rr *groff_eqn_1_man_C
2295 .
2296 .
2297 .\" Local Variables:
2298 .\" fill-column: 72
2299 .\" mode: nroff
2300 .\" tab-width: 12
2301 .\" End:
2302 .\" vim: set filetype=groff tabstop=12 textwidth=72: