Research V7 development
[unix-history] / usr / man / man1 / eqn.1
CommitLineData
4a89f44c
BK
1.EQ
2delim $$
3.EN
4.TH EQN 1 2/22/74
5.SH NAME
6eqn, neqn, checkeq \- typeset mathematics
7.SH SYNOPSIS
8.B eqn
9[
10.BR \-d xy
11] [
12.BR \-p n
13] [
14.BR \-s n
15] [
16.BR \-f n
17]
18[ file ] ...
19.br
20.B checkeq
21[ file ] ...
22.SH DESCRIPTION
23.I Eqn
24is a
25troff(1)
26preprocessor
27for typesetting mathematics
28on a Graphic Systems phototypesetter,
29.I neqn
30on terminals.
31Usage is almost always
32.PP
33 eqn file ... | troff
34.br
35 neqn file ... | nroff
36.PP
37If no files are specified,
38these programs
39reads from the standard input.
40A line beginning with `.EQ' marks the start of an equation;
41the end of an equation
42is marked by a line beginning with `.EN'.
43Neither of these lines is altered,
44so they may be defined in macro packages
45to get
46centering, numbering, etc.
47It is also possible to set two characters as `delimiters';
48subsequent text between delimiters is also treated as
49.ul
50eqn
51input.
52Delimiters may be set to characters
53.I x
54and
55.I y
56with the command-line argument
57.BI \-d xy
58or (more commonly) with
59`delim
60.IR xy '
61between .EQ and .EN.
62The left and right delimiters may be identical.
63Delimiters are turned off by `delim off'.
64All text that is neither between delimiters nor between .EQ and .EN
65is passed through untouched.
66.PP
67The program
68.I checkeq
69reports missing or unbalanced delimiters and .EQ/.EN pairs.
70.PP
71Tokens within
72.I eqn
73are separated by
74spaces, tabs, newlines, braces, double quotes,
75tildes or circumflexes.
76Braces {} are used for grouping;
77generally speaking,
78anywhere a single character like
79.I x
80could appear, a complicated construction
81enclosed in braces may be used instead.
82Tilde ~ represents a full space in the output,
83circumflex ^ half as much.
84.PP
85.vs 13p
86Subscripts and superscripts are produced with the keywords
87.B sub
88and
89.B sup.
90Thus
91.I "x sub i"
92makes
93$x sub i$,
94.I "a sub i sup 2"
95produces
96$a sub i sup 2$,
97and
98.I "e sup {x sup 2 + y sup 2}"
99gives
100$e sup {x sup 2 + y sup 2}$.
101.PP
102Fractions are made with
103.BR over :
104.I "a over b"
105yields $a over b$.
106.PP
107.B sqrt
108makes square roots:
109.I "1 over sqrt {ax sup 2 +bx+c}"
110results in
111$1 over sqrt {ax sup 2 +bx+c}$ .
112.PP
113The keywords
114.B from
115and
116.B to
117introduce lower and upper
118limits on arbitrary things:
119$lim from {n-> inf} sum from 0 to n x sub i$
120is made with
121.I "lim from {n\-> inf } sum from 0 to n x sub i."
122.PP
123Left and right brackets, braces, etc., of the right height are made with
124.B left
125and
126.B right:
127.I "left [ x sup 2 + y sup 2 over alpha right ] ~=~1"
128produces
129$left [ x sup 2 + y sup 2 over alpha right ] ~=~1$.
130The
131.B right
132clause is optional.
133Legal characters after
134.B left
135and
136.B right
137are braces, brackets, bars,
138.B c
139and
140.B f
141for ceiling and floor,
142and "" for nothing at all (useful for a right-side-only bracket).
143.PP
144Vertical piles of things are made with
145.BR pile ,
146.BR lpile ,
147.BR cpile ,
148and
149.BR rpile :
150.I "pile {a above b above c}"
151produces
152$pile {a above b above c}$.
153There can be an arbitrary number of elements in a pile.
154.B lpile
155left-justifies,
156.B pile
157and
158.B cpile
159center, with different vertical spacing,
160and
161.B rpile
162right justifies.
163.PP
164Matrices are made with
165.BR matrix :
166.I "matrix { lcol { x sub i above y sub 2 } ccol { 1 above 2 } }"
167produces
168$matrix { lcol { x sub i above y sub 2 } ccol { 1 above 2 } }$.
169In addition, there is
170.B rcol
171for a right-justified column.
172.PP
173.vs 12p
174Diacritical marks are made with
175.BR dot ,
176.BR dotdot ,
177.BR hat ,
178.BR tilde ,
179.BR bar ,
180.BR vec ,
181.BR dyad ,
182and
183.BR under :
184.I "x dot = f(t) bar"
185is
186$x dot = f(t) bar$,
187.I "y dotdot bar ~=~ n under"
188is
189$y dotdot bar ~=~ n under$,
190and
191.I "x vec ~=~ y dyad"
192is
193$x vec ~=~ y dyad$.
194.PP
195Sizes and font can be changed with
196.B size
197.I n
198or
199.B size
200.BI \(+- n,
201.BR roman ,
202.BR italic ,
203.BR bold ,
204and
205.BR font
206.I n.
207Size and fonts can be changed globally in a document by
208.B gsize
209.I n
210and
211.B gfont
212.IR n ,
213or by the command-line arguments
214.BI \-s n
215and
216.BI \-f n.
217.PP
218Normally subscripts and superscripts are reduced by
2193 point sizes from the previous size;
220this may be changed by the command-line argument
221.BI \-p n.
222.PP
223Successive display arguments can be lined up.
224Place
225.B mark
226before the desired lineup point in the first equation;
227place
228.B lineup
229at the place that is to line up vertically in subsequent equations.
230.PP
231Shorthands may be defined
232or existing keywords redefined with
233.BI define :
234.I "define thing % replacement %"
235defines a new token called
236.I thing
237which will be replaced by
238.I replacement
239whenever it appears thereafter.
240The
241.I %
242may be any character that does not occur in
243.I replacement.
244.PP
245Keywords like
246.I sum
247.EQ
248( sum )
249.EN
250.I int
251.EQ
252( int )
253.EN
254.I inf
255.EQ
256( inf )
257.EN
258and shorthands like
259>=
260.EQ
261(>=)
262.EN
263\->
264.EQ
265(->),
266.EN
267and
268!=
269.EQ
270( != )
271.EN
272are recognized.
273Greek letters are spelled out in the desired case, as in
274.I alpha
275or
276.I GAMMA.
277Mathematical words like sin, cos, log are made Roman automatically.
278.IR Troff (1)
279four-character escapes like \e(bs (\(bs)
280can be used anywhere.
281Strings enclosed in double quotes "..."
282are passed through untouched;
283this permits keywords to be entered as text,
284and can be used to communicate
285with
286.I troff
287when all else fails.
288.SH "SEE ALSO"
289.PP
290troff(1), tbl(1), ms(7), eqnchar(7)
291.br
292B. W. Kernighan and L. L. Cherry,
293.ul
294Typesetting Mathematics\(emUser's Guide
295.br
296J. F. Ossanna,
297.ul
298NROFF/TROFF User's Manual
299.SH BUGS
300.PP
301To embolden digits, parens, etc.,
302it is necessary to quote them,
303as in `bold "12.3"'.