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