Debian Codegraph @

upstream/debian-unstable/man1/eqn.1

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