xref: /titanic_41/usr/src/man/man5/eqn.5 (revision 32a712da90cea6ff9a05f51e7844944ccfa28d5e)
1*32a712daSGarrett D'Amore.\"
2*32a712daSGarrett D'Amore.\" Permission to use, copy, modify, and distribute this software for any
3*32a712daSGarrett D'Amore.\" purpose with or without fee is hereby granted, provided that the above
4*32a712daSGarrett D'Amore.\" copyright notice and this permission notice appear in all copies.
5*32a712daSGarrett D'Amore.\"
6*32a712daSGarrett D'Amore.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7*32a712daSGarrett D'Amore.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
8*32a712daSGarrett D'Amore.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9*32a712daSGarrett D'Amore.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
10*32a712daSGarrett D'Amore.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
11*32a712daSGarrett D'Amore.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
12*32a712daSGarrett D'Amore.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13*32a712daSGarrett D'Amore.\"
14*32a712daSGarrett D'Amore.\"
15*32a712daSGarrett D'Amore.\" Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
16*32a712daSGarrett D'Amore.\" Copyright 2012 Nexenta Systems, Inc. All rights reserved.
17*32a712daSGarrett D'Amore.\"
18*32a712daSGarrett D'Amore.Dd Jul 19, 2014
19*32a712daSGarrett D'Amore.Dt EQN 5
20*32a712daSGarrett D'Amore.Os
21*32a712daSGarrett D'Amore.Sh NAME
22*32a712daSGarrett D'Amore.Nm eqn
23*32a712daSGarrett D'Amore.Nd eqn language reference for mandoc
24*32a712daSGarrett D'Amore.Sh DESCRIPTION
25*32a712daSGarrett D'AmoreThe
26*32a712daSGarrett D'Amore.Nm eqn
27*32a712daSGarrett D'Amorelanguage is an equation-formatting language.
28*32a712daSGarrett D'AmoreIt is used within
29*32a712daSGarrett D'Amore.Xr mdoc 5
30*32a712daSGarrett D'Amoreand
31*32a712daSGarrett D'Amore.Xr man 5
32*32a712daSGarrett D'Amore.Ux
33*32a712daSGarrett D'Amoremanual pages.
34*32a712daSGarrett D'AmoreIt describes the
35*32a712daSGarrett D'Amore.Em structure
36*32a712daSGarrett D'Amoreof an equation, not its mathematical meaning.
37*32a712daSGarrett D'AmoreThis manual describes the
38*32a712daSGarrett D'Amore.Nm
39*32a712daSGarrett D'Amorelanguage accepted by the
40*32a712daSGarrett D'Amore.Xr mandoc 1
41*32a712daSGarrett D'Amoreutility, which corresponds to the Second Edition eqn specification (see
42*32a712daSGarrett D'Amore.Sx SEE ALSO
43*32a712daSGarrett D'Amorefor references).
44*32a712daSGarrett D'Amore.Pp
45*32a712daSGarrett D'AmoreEquations within
46*32a712daSGarrett D'Amore.Xr mdoc 5
47*32a712daSGarrett D'Amoreor
48*32a712daSGarrett D'Amore.Xr man 5
49*32a712daSGarrett D'Amoredocuments are enclosed by the standalone
50*32a712daSGarrett D'Amore.Sq \&.EQ
51*32a712daSGarrett D'Amoreand
52*32a712daSGarrett D'Amore.Sq \&.EN
53*32a712daSGarrett D'Amoretags.
54*32a712daSGarrett D'AmoreEquations are multi-line blocks consisting of formulas and control
55*32a712daSGarrett D'Amorestatements.
56*32a712daSGarrett D'Amore.Sh EQUATION STRUCTURE
57*32a712daSGarrett D'AmoreEach equation is bracketed by
58*32a712daSGarrett D'Amore.Sq \&.EQ
59*32a712daSGarrett D'Amoreand
60*32a712daSGarrett D'Amore.Sq \&.EN
61*32a712daSGarrett D'Amorestrings.
62*32a712daSGarrett D'Amore.Em Note :
63*32a712daSGarrett D'Amorethese are not the same as
64*32a712daSGarrett D'Amore.Xr roff 5
65*32a712daSGarrett D'Amoremacros, and may only be invoked as
66*32a712daSGarrett D'Amore.Sq \&.EQ .
67*32a712daSGarrett D'Amore.Pp
68*32a712daSGarrett D'AmoreThe equation grammar is as follows, where quoted strings are
69*32a712daSGarrett D'Amorecase-sensitive literals in the input:
70*32a712daSGarrett D'Amore.Bd -literal -offset indent
71*32a712daSGarrett D'Amoreeqn     : box | eqn box
72*32a712daSGarrett D'Amorebox     : text
73*32a712daSGarrett D'Amore        | \*q{\*q eqn \*q}\*q
74*32a712daSGarrett D'Amore        | \*qdefine\*q text text
75*32a712daSGarrett D'Amore        | \*qndefine\*q text text
76*32a712daSGarrett D'Amore        | \*qtdefine\*q text text
77*32a712daSGarrett D'Amore        | \*qgfont\*q text
78*32a712daSGarrett D'Amore        | \*qgsize\*q text
79*32a712daSGarrett D'Amore        | \*qset\*q text text
80*32a712daSGarrett D'Amore        | \*qundef\*q text
81*32a712daSGarrett D'Amore        | box pos box
82*32a712daSGarrett D'Amore        | box mark
83*32a712daSGarrett D'Amore        | \*qmatrix\*q \*q{\*q [col \*q{\*q list \*q}\*q ]*
84*32a712daSGarrett D'Amore        | pile \*q{\*q list \*q}\*q
85*32a712daSGarrett D'Amore        | font box
86*32a712daSGarrett D'Amore        | \*qsize\*q text box
87*32a712daSGarrett D'Amore        | \*qleft\*q text eqn [\*qright\*q text]
88*32a712daSGarrett D'Amorecol     : \*qlcol\*q | \*qrcol\*q | \*qccol\*q | \*qcol\*q
89*32a712daSGarrett D'Amoretext    : [^space\e\*q]+ | \e\*q.*\e\*q
90*32a712daSGarrett D'Amorepile    : \*qlpile\*q | \*qcpile\*q | \*qrpile\*q | \*qpile\*q
91*32a712daSGarrett D'Amorepos     : \*qover\*q | \*qsup\*q | \*qsub\*q | \*qto\*q | \*qfrom\*q
92*32a712daSGarrett D'Amoremark	: \*qdot\*q | \*qdotdot\*q | \*qhat\*q | \*qtilde\*q | \*qvec\*q
93*32a712daSGarrett D'Amore        | \*qdyad\*q | \*qbar\*q | \*qunder\*q
94*32a712daSGarrett D'Amorefont    : \*qroman\*q | \*qitalic\*q | \*qbold\*q | \*qfat\*q
95*32a712daSGarrett D'Amorelist    : eqn
96*32a712daSGarrett D'Amore        | list \*qabove\*q eqn
97*32a712daSGarrett D'Amorespace   : [\e^~ \et]
98*32a712daSGarrett D'Amore.Ed
99*32a712daSGarrett D'Amore.Pp
100*32a712daSGarrett D'AmoreWhite-space consists of the space, tab, circumflex, and tilde
101*32a712daSGarrett D'Amorecharacters.
102*32a712daSGarrett D'AmoreIf within a quoted string, these space characters are retained.
103*32a712daSGarrett D'AmoreQuoted strings are also not scanned for replacement definitions.
104*32a712daSGarrett D'Amore.Pp
105*32a712daSGarrett D'AmoreThe following text terms are translated into a rendered glyph, if
106*32a712daSGarrett D'Amoreavailable: alpha, beta, chi, delta, epsilon, eta, gamma, iota, kappa,
107*32a712daSGarrett D'Amorelambda, mu, nu, omega, omicron, phi, pi, psi, rho, sigma, tau, theta,
108*32a712daSGarrett D'Amoreupsilon, xi, zeta, DELTA, GAMMA, LAMBDA, OMEGA, PHI, PI, PSI, SIGMA,
109*32a712daSGarrett D'AmoreTHETA, UPSILON, XI, inter (intersection), union (union), prod (product),
110*32a712daSGarrett D'Amoreint (integral), sum (summation), grad (gradient), del (vector
111*32a712daSGarrett D'Amoredifferential), times (multiply), cdot (centre-dot), nothing (zero-width
112*32a712daSGarrett D'Amorespace), approx (approximately equals), prime (prime), half (one-half),
113*32a712daSGarrett D'Amorepartial (partial differential), inf (infinity), >> (much greater), <<
114*32a712daSGarrett D'Amore(much less), \-> (left arrow), <\- (right arrow), += (plus-minus), !=
115*32a712daSGarrett D'Amore(not equal), == (equivalence), <= (less-than-equal), and >=
116*32a712daSGarrett D'Amore(more-than-equal).
117*32a712daSGarrett D'Amore.Pp
118*32a712daSGarrett D'AmoreThe following control statements are available:
119*32a712daSGarrett D'Amore.Bl -tag -width Ds
120*32a712daSGarrett D'Amore.It Cm define
121*32a712daSGarrett D'AmoreReplace all occurrences of a key with a value.
122*32a712daSGarrett D'AmoreIts syntax is as follows:
123*32a712daSGarrett D'Amore.Pp
124*32a712daSGarrett D'Amore.D1 define Ar key cvalc
125*32a712daSGarrett D'Amore.Pp
126*32a712daSGarrett D'AmoreThe first character of the value string,
127*32a712daSGarrett D'Amore.Ar c ,
128*32a712daSGarrett D'Amoreis used as the delimiter for the value
129*32a712daSGarrett D'Amore.Ar val .
130*32a712daSGarrett D'AmoreThis allows for arbitrary enclosure of terms (not just quotes), such as
131*32a712daSGarrett D'Amore.Pp
132*32a712daSGarrett D'Amore.D1 define Ar foo 'bar baz'
133*32a712daSGarrett D'Amore.D1 define Ar foo cbar bazc
134*32a712daSGarrett D'Amore.Pp
135*32a712daSGarrett D'AmoreIt is an error to have an empty
136*32a712daSGarrett D'Amore.Ar key
137*32a712daSGarrett D'Amoreor
138*32a712daSGarrett D'Amore.Ar val .
139*32a712daSGarrett D'AmoreNote that a quoted
140*32a712daSGarrett D'Amore.Ar key
141*32a712daSGarrett D'Amorecauses errors in some
142*32a712daSGarrett D'Amore.Nm
143*32a712daSGarrett D'Amoreimplementations and should not be considered portable.
144*32a712daSGarrett D'AmoreIt is not expanded for replacements.
145*32a712daSGarrett D'AmoreDefinitions may refer to other definitions; these are evaluated
146*32a712daSGarrett D'Amorerecursively when text replacement occurs and not when the definition is
147*32a712daSGarrett D'Amorecreated.
148*32a712daSGarrett D'Amore.Pp
149*32a712daSGarrett D'AmoreDefinitions can create arbitrary strings, for example, the following is
150*32a712daSGarrett D'Amorea legal construction.
151*32a712daSGarrett D'Amore.Bd -literal -offset indent
152*32a712daSGarrett D'Amoredefine foo 'define'
153*32a712daSGarrett D'Amorefoo bar 'baz'
154*32a712daSGarrett D'Amore.Ed
155*32a712daSGarrett D'Amore.Pp
156*32a712daSGarrett D'AmoreSelf-referencing definitions will raise an error.
157*32a712daSGarrett D'AmoreThe
158*32a712daSGarrett D'Amore.Cm ndefine
159*32a712daSGarrett D'Amorestatement is a synonym for
160*32a712daSGarrett D'Amore.Cm define ,
161*32a712daSGarrett D'Amorewhile
162*32a712daSGarrett D'Amore.Cm tdefine
163*32a712daSGarrett D'Amoreis discarded.
164*32a712daSGarrett D'Amore.It Cm gfont
165*32a712daSGarrett D'AmoreSet the default font of subsequent output.
166*32a712daSGarrett D'AmoreIts syntax is as follows:
167*32a712daSGarrett D'Amore.Pp
168*32a712daSGarrett D'Amore.D1 gfont Ar font
169*32a712daSGarrett D'Amore.Pp
170*32a712daSGarrett D'AmoreIn
171*32a712daSGarrett D'Amore.Xr mandoc 1 ,
172*32a712daSGarrett D'Amorethis value is discarded.
173*32a712daSGarrett D'Amore.It Cm gsize
174*32a712daSGarrett D'AmoreSet the default size of subsequent output.
175*32a712daSGarrett D'AmoreIts syntax is as follows:
176*32a712daSGarrett D'Amore.Pp
177*32a712daSGarrett D'Amore.D1 gsize Ar size
178*32a712daSGarrett D'Amore.Pp
179*32a712daSGarrett D'AmoreThe
180*32a712daSGarrett D'Amore.Ar size
181*32a712daSGarrett D'Amorevalue should be an integer.
182*32a712daSGarrett D'Amore.It Cm set
183*32a712daSGarrett D'AmoreSet an equation mode.
184*32a712daSGarrett D'AmoreIn
185*32a712daSGarrett D'Amore.Xr mandoc 1 ,
186*32a712daSGarrett D'Amoreboth arguments are thrown away.
187*32a712daSGarrett D'AmoreIts syntax is as follows:
188*32a712daSGarrett D'Amore.Pp
189*32a712daSGarrett D'Amore.D1 set Ar key val
190*32a712daSGarrett D'Amore.Pp
191*32a712daSGarrett D'AmoreThe
192*32a712daSGarrett D'Amore.Ar key
193*32a712daSGarrett D'Amoreand
194*32a712daSGarrett D'Amore.Ar val
195*32a712daSGarrett D'Amoreare not expanded for replacements.
196*32a712daSGarrett D'AmoreThis statement is a GNU extension.
197*32a712daSGarrett D'Amore.It Cm undef
198*32a712daSGarrett D'AmoreUnset a previously-defined key.
199*32a712daSGarrett D'AmoreIts syntax is as follows:
200*32a712daSGarrett D'Amore.Pp
201*32a712daSGarrett D'Amore.D1 define Ar key
202*32a712daSGarrett D'Amore.Pp
203*32a712daSGarrett D'AmoreOnce invoked, the definition for
204*32a712daSGarrett D'Amore.Ar key
205*32a712daSGarrett D'Amoreis discarded.
206*32a712daSGarrett D'AmoreThe
207*32a712daSGarrett D'Amore.Ar key
208*32a712daSGarrett D'Amoreis not expanded for replacements.
209*32a712daSGarrett D'AmoreThis statement is a GNU extension.
210*32a712daSGarrett D'Amore.El
211*32a712daSGarrett D'Amore.Sh COMPATIBILITY
212*32a712daSGarrett D'AmoreThis section documents the compatibility of
213*32a712daSGarrett D'Amore.Xr mandoc 1
214*32a712daSGarrett D'Amore.Nm
215*32a712daSGarrett D'Amoreand the
216*32a712daSGarrett D'Amore.Xr troff 1
217*32a712daSGarrett D'Amore.Nm
218*32a712daSGarrett D'Amoreimplementation (including GNU troff).
219*32a712daSGarrett D'Amore.Pp
220*32a712daSGarrett D'Amore.Bl -dash -compact
221*32a712daSGarrett D'Amore.It
222*32a712daSGarrett D'AmoreThe text string
223*32a712daSGarrett D'Amore.Sq \e\*q
224*32a712daSGarrett D'Amoreis interpreted as a literal quote in
225*32a712daSGarrett D'Amore.Xr troff 1 .
226*32a712daSGarrett D'AmoreIn
227*32a712daSGarrett D'Amore.Xr mandoc 1 ,
228*32a712daSGarrett D'Amorethis is interpreted as a comment.
229*32a712daSGarrett D'Amore.It
230*32a712daSGarrett D'AmoreIn
231*32a712daSGarrett D'Amore.Xr troff 1 ,
232*32a712daSGarrett D'AmoreThe circumflex and tilde white-space symbols map to
233*32a712daSGarrett D'Amorefixed-width spaces.
234*32a712daSGarrett D'AmoreIn
235*32a712daSGarrett D'Amore.Xr mandoc 1 ,
236*32a712daSGarrett D'Amorethese characters are synonyms for the space character.
237*32a712daSGarrett D'Amore.It
238*32a712daSGarrett D'AmoreThe
239*32a712daSGarrett D'Amore.Xr troff 1 ,
240*32a712daSGarrett D'Amoreimplementation of
241*32a712daSGarrett D'Amore.Nm
242*32a712daSGarrett D'Amoreallows for equation alignment with the
243*32a712daSGarrett D'Amore.Cm mark
244*32a712daSGarrett D'Amoreand
245*32a712daSGarrett D'Amore.Cm lineup
246*32a712daSGarrett D'Amoretokens.
247*32a712daSGarrett D'Amore.Xr mandoc 1
248*32a712daSGarrett D'Amorediscards these tokens.
249*32a712daSGarrett D'AmoreThe
250*32a712daSGarrett D'Amore.Cm back Ar n ,
251*32a712daSGarrett D'Amore.Cm fwd Ar n ,
252*32a712daSGarrett D'Amore.Cm up Ar n ,
253*32a712daSGarrett D'Amoreand
254*32a712daSGarrett D'Amore.Cm down Ar n
255*32a712daSGarrett D'Amorecommands are also ignored.
256*32a712daSGarrett D'Amore.El
257*32a712daSGarrett D'Amore.Sh SEE ALSO
258*32a712daSGarrett D'Amore.Xr mandoc 1 ,
259*32a712daSGarrett D'Amore.Xr man 5 ,
260*32a712daSGarrett D'Amore.Xr mandoc_char 5 ,
261*32a712daSGarrett D'Amore.Xr mdoc 5 ,
262*32a712daSGarrett D'Amore.Xr roff 5
263*32a712daSGarrett D'Amore.Rs
264*32a712daSGarrett D'Amore.%A Brian W. Kernighan
265*32a712daSGarrett D'Amore.%A Lorinda L. Cherry
266*32a712daSGarrett D'Amore.%T System for Typesetting Mathematics
267*32a712daSGarrett D'Amore.%J Communications of the ACM
268*32a712daSGarrett D'Amore.%V 18
269*32a712daSGarrett D'Amore.%P 151\(en157
270*32a712daSGarrett D'Amore.%D March, 1975
271*32a712daSGarrett D'Amore.Re
272*32a712daSGarrett D'Amore.Rs
273*32a712daSGarrett D'Amore.%A Brian W. Kernighan
274*32a712daSGarrett D'Amore.%A Lorinda L. Cherry
275*32a712daSGarrett D'Amore.%T Typesetting Mathematics, User's Guide
276*32a712daSGarrett D'Amore.%D 1976
277*32a712daSGarrett D'Amore.Re
278*32a712daSGarrett D'Amore.Rs
279*32a712daSGarrett D'Amore.%A Brian W. Kernighan
280*32a712daSGarrett D'Amore.%A Lorinda L. Cherry
281*32a712daSGarrett D'Amore.%T Typesetting Mathematics, User's Guide (Second Edition)
282*32a712daSGarrett D'Amore.%D 1978
283*32a712daSGarrett D'Amore.Re
284*32a712daSGarrett D'Amore.Sh HISTORY
285*32a712daSGarrett D'AmoreThe eqn utility, a preprocessor for troff, was originally written by
286*32a712daSGarrett D'AmoreBrian W. Kernighan and Lorinda L. Cherry in 1975.
287*32a712daSGarrett D'AmoreThe GNU reimplementation of eqn, part of the GNU troff package, was
288*32a712daSGarrett D'Amorereleased in 1989 by James Clark.
289*32a712daSGarrett D'AmoreThe eqn component of
290*32a712daSGarrett D'Amore.Xr mandoc 1
291*32a712daSGarrett D'Amorewas added in 2011.
292*32a712daSGarrett D'Amore.Sh AUTHORS
293*32a712daSGarrett D'AmoreThis
294*32a712daSGarrett D'Amore.Nm
295*32a712daSGarrett D'Amorereference was written by
296*32a712daSGarrett D'Amore.An Kristaps Dzonsons ,
297*32a712daSGarrett D'Amore.Mt kristaps@bsd.lv .
298