1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
|
'\" te
.\" Copyright (C) 2002, Sun Microsystems, Inc.
.\" All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH EQN 1 "Jul 12, 2002"
.SH NAME
eqn, neqn, checkeq \- typeset mathematics test
.SH SYNOPSIS
.LP
.nf
\fBeqn\fR [\fB-d\fR \fIxy\fR] [\fB -f\fR \fIn\fR] [\fB-p\fR \fIn\fR] [\fB -s\fR \fIn\fR] [\fIfile\fR]...
.fi
.LP
.nf
\fBneqn\fR [\fIfile\fR]...
.fi
.LP
.nf
\fBcheckeq\fR [\fIfile\fR]...
.fi
.SH DESCRIPTION
.sp
.LP
\fBeqn\fR and \fBneqn\fR are language processors to assist in describing
equations. \fBeqn\fR is a preprocessor for \fBtroff\fR(1) and is intended for
devices that can print \fBtroff\fR's output. \fBneqn\fR is a preprocessor for
\fBnroff\fR(1) and is intended for use with terminals. Usage is almost always:
.sp
.in +2
.nf
example% \fBeqn file ... | troff\fR
example% \fBneqn file ... | nroff\fR
.fi
.in -2
.sp
.sp
.LP
If no \fIfile\fRs are specified, \fBeqn\fR and \fBneqn\fR read from the
standard input. A line beginning with \fB\&.EQ\fR marks the start of an
equation. The end of an equation is marked by a line beginning with
\fB\&.EN\fR. Neither of these lines is altered, so they may be defined in macro
packages to get centering, numbering, and so on. It is also possible to set
two characters as ``delimiters''; subsequent text between delimiters is also
treated as \fBeqn\fR input.
.sp
.LP
\fBcheckeq\fR reports missing or unbalanced delimiters and
\fB\&.EQ\fR/\fB\&.EN\fR pairs.
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-d\fR\fIxy\fR \fR
.ad
.RS 9n
Sets equation delimiters set to characters \fIx\fR and \fIy\fR with the
command-line argument. The more common way to do this is with \fBdelim\fR\fI
xy\fR between \fB\&.EQ\fR and \fB\&.EN\fR. The left and right delimiters may be
identical. Delimiters are turned off by \fBdelim\fR \fBoff\fR appearing in the
text. All text that is neither between delimiters nor between \fB\&.EQ\fR and
\fB\&.EN\fR is passed through untouched.
.RE
.sp
.ne 2
.na
\fB\fB-f\fR\fIn\fR \fR
.ad
.RS 9n
Changes font to \fIn\fR globally in the document. The font can also be changed
globally in the body of the document by using the \fBgfont\fR\fI n\fR
directive, where \fIn\fR is the font specification.
.RE
.sp
.ne 2
.na
\fB\fB-p\fR\fIn\fR \fR
.ad
.RS 9n
Reduces subscripts and superscripts by \fIn\fR point sizes from the previous
size. In the absence of the \fB-p\fR option, subscripts and superscripts are
reduced by 3 point sizes from the previous size.
.RE
.sp
.ne 2
.na
\fB\fB-s\fR\fIn\fR \fR
.ad
.RS 9n
Changes point size to \fIn\fR globally in the document. The point size can also
be changed globally in the body of the document by using the \fBgsize\fR\fI
n\fR directive, where \fIn\fR is the point size.
.RE
.SH OPERANDS
.sp
.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fIfile\fR \fR
.ad
.RS 9n
The nroff or troff file processed by \fBeqn\fR or \fBneqn\fR.
.RE
.SH EQN LANGUAGE
.sp
.LP
The nroff version of this description depicts the output of \fBneqn\fR to the
terminal screen exactly as \fBneqn\fR is able to display it. To see an
accurate depiction of the output, view the printed version of this page.
.sp
.LP
Tokens within \fBeqn\fR are separated by braces, double quotes, tildes,
circumflexes, SPACE, TAB, or NEWLINE characters. Braces {\|} are used for
grouping. Generally speaking, anywhere a single character like \fIx\fR could
appear, a complicated construction enclosed in braces may be used instead. A
tilde (\fB~\fR) represents a full SPACE in the output; a circumflex (\fB^\fR)
half as much.
.sp
.ne 2
.na
\fBSubscripts and superscripts:\fR
.ad
.sp .6
.RS 4n
These are produced with the keywords \fBsub\fR and \fBsup\fR.
.sp
.ne 2
.na
\fB\fBx sub i\fR\fR
.ad
.RS 29n
makes
.EQ
delim $$
.EN
$x sub i$
.sp
.RE
.sp
.ne 2
.na
\fB\fBa sub i sup 2\fR \fR
.ad
.RS 29n
produces
.EQ
delim $$
.EN
$a sub i sup 2$
.sp
.RE
.sp
.ne 2
.na
\fB\fBe sup {x sup 2 + y sup 2}\fR\fR
.ad
.RS 29n
gives e^(x^2+y^2)
.sp
.RE
.RE
.sp
.ne 2
.na
\fBFractions:\fR
.ad
.sp .6
.RS 4n
Fractions are made with \fBover\fR.
.sp
.ne 2
.na
\fB\fBa over b\fR \fR
.ad
.RS 13n
yields
.EQ
delim $$
.EN
$a over b$
.sp
.RE
.RE
.sp
.ne 2
.na
\fBSquare Roots:\fR
.ad
.sp .6
.RS 4n
These are made with \fBsqrt\fR
.sp
.ne 2
.na
\fB\fB1 over sqrt {ax sup 2 +bx+c}\fR \fR
.ad
.sp .6
.RS 4n
results in
.EQ
delim $$
.EN
$1 over sqrt {ax sup 2 +bx+c}$
.sp
.RE
.RE
.sp
.ne 2
.na
\fBLimits:\fR
.ad
.sp .6
.RS 4n
The keywords \fBfrom\fR and \fBto\fR introduce lower and upper limits on
arbitrary things:
.sp
.ne 2
.na
\fB\fBlim from {n\(-> inf } sum from 0 to n x sub i\fR\fR
.ad
.sp .6
.RS 4n
makes
.EQ
delim $$
.EN
$lim from {n\(-> inf } sum from 0 to n x sub i$
.sp
.RE
.RE
.sp
.ne 2
.na
\fBBrackets and Braces:\fR
.ad
.sp .6
.RS 4n
Left and right brackets, braces, and the like, of the right height are made
with \fBleft\fR and \fBright\fR.
.sp
.ne 2
.na
\fB\fBleft [ x sup 2 + y sup 2 over alpha right ] ~=~1\fR \fR
.ad
.sp .6
.RS 4n
produces
.EQ
delim $$
.EN
$left [ x sup 2 + y sup 2 over alpha right ] ~=~1$
.sp
.sp
The \fBright\fR clause is optional. Legal characters after \fBleft\fR and
\fBright\fR are braces, brackets, bars, \fBc\fR and \fBf\fR for ceiling and
floor, and \fB""\fR for nothing at all (useful for a right-side-only bracket).
.RE
.RE
.sp
.ne 2
.na
\fBVertical piles:\fR
.ad
.sp .6
.RS 4n
Vertical piles of things are made with \fBpile\fR, \fBlpile\fR, \fBcpile\fR,
and \fBrpile\fR.
.sp
.ne 2
.na
\fB\fBpile {a above b above c}\fR\fR
.ad
.RS 28n
produces
.EQ
delim $$
.EN
$pile {a above b above c}$
.sp
.sp
There can be an arbitrary number of elements in a pile. \fBlpile\fR
left-justifies, \fBpile\fR and \fBcpile\fR center, with different vertical
spacing, and \fBrpile\fR right justifies.
.RE
.RE
.sp
.ne 2
.na
\fBMatrices:\fR
.ad
.sp .6
.RS 4n
Matrices are made with \fBmatrix\fR.
.sp
.ne 2
.na
\fB\fBmatrix { lcol { x sub i above y sub 2 } ccol { 1 above 2 } }\fR \fR
.ad
.sp .6
.RS 4n
produces
.EQ
delim $$
.EN
$matrix { lcol { x sub i above y sub 2 } ccol { 1 above 2 } }$
.sp
.sp
In addition, there is \fBrcol\fR for a right-justified column.
.RE
.RE
.sp
.ne 2
.na
\fBDiacritical marks:\fR
.ad
.sp .6
.RS 4n
Diacritical marks are made with \fBdot\fR, \fBdotdot\fR, \fBhat\fR,
\fBtilde\fR, \fBbar\fR, \fBvec\fR, \fBdyad\fR, and \fBunder\fR.
.sp
.ne 2
.na
\fB\fBx dot = f(t) bar\fR\fR
.ad
.RS 28n
is
.EQ
delim $$
.EN
$x dot = f(t) bar$
.sp
.RE
.sp
.ne 2
.na
\fB\fBy dotdot bar ~=~ n under\fR\fR
.ad
.RS 28n
is
.EQ
delim $$
.EN
$y dotdot bar ~=~ n under$
.sp
.RE
.sp
.ne 2
.na
\fB\fBx vec ~=~ y dyad\fR \fR
.ad
.RS 28n
is
.EQ
delim $$
.EN
$x vec ~=~ y dyad$
.sp
.RE
.RE
.sp
.ne 2
.na
\fBSizes and Fonts:\fR
.ad
.sp .6
.RS 4n
Sizes and font can be changed with \fBsize\fR \fIn\fR or \fBsize\fR
\fB\(+-\fR\fIn,\fR \fBroman\fR, \fBitalic\fR, \fBbold\fR, and \fBfont\fR
\fIn\fR. Size and fonts can be changed globally in a document by \fBgsize\fR
\fIn\fR and \fBgfont\fR \fIn\fR, or by the command-line arguments
\fB-s\fR\fIn\fR and \fB-f\fR\fIn.\fR
.RE
.sp
.ne 2
.na
\fBSuccessive display arguments:\fR
.ad
.sp .6
.RS 4n
Successive display arguments can be lined up. Place \fBmark\fR before the
desired lineup point in the first equation; place \fBlineup\fR at the place
that is to line up vertically in subsequent equations.
.RE
.sp
.ne 2
.na
\fBShorthands:\fR
.ad
.sp .6
.RS 4n
Shorthands may be defined or existing keywords redefined with
\fBdefine\fR\fI:\fR
.sp
.ne 2
.na
\fB\fBdefine\fR\fI thing \fR\fB%\fR\fI replacement \fR\fB%\fR \fR
.ad
.sp .6
.RS 4n
Defines a new token called \fIthing\fR which will be replaced by
\fIreplacement\fR whenever it appears thereafter. The \fB%\fR may be any
character that does not occur in \fIreplacement\fR.
.RE
.RE
.sp
.ne 2
.na
\fBKeywords and Shorthands:\fR
.ad
.sp .6
.RS 4n
Keywords like \fBsum\fR \fBint\fR \fBinf\fR and shorthands like \fB>=\fR
\fB\(->\fR and \fB!=\fR are recognized.
.RE
.sp
.ne 2
.na
\fBGreek letters:\fR
.ad
.sp .6
.RS 4n
Greek letters are spelled out in the desired case, as in \fBalpha\fR or
\fBGAMMA\fR.
.RE
.sp
.ne 2
.na
\fBMathematical words:\fR
.ad
.sp .6
.RS 4n
Mathematical words like \fBsin\fR,\fB cos\fR, and \fBlog\fR are made Roman
automatically.
.RE
.sp
.LP
\fBtroff\fR(1) four-character escapes like \(bu (\(bu) can be used anywhere.
Strings enclosed in double quotes \fB"\fR.\|.\|.\fB"\fR are passed through
untouched; this permits keywords to be entered as text, and can be used to
communicate with \fBtroff\fR when all else fails.
.SH SEE ALSO
.sp
.LP
.BR nroff (1),
.BR tbl (1),
.BR troff (1),
.BR attributes (7),
.BR ms (7)
.SH BUGS
.sp
.LP
To embolden characters such as digits and parentheses, it is necessary to
quote them, as in `\fBbold "12.3"\fR'.
|