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