1eqn(1)                           User Commands                          eqn(1)
2
3
4

NAME

6       eqn, neqn, checkeq - typeset mathematics test
7

SYNOPSIS

9       eqn [-d xy] [ -f n] [-p n] [ -s n] [file]...
10
11
12       neqn [file]...
13
14
15       checkeq [file]...
16
17

DESCRIPTION

19       eqn and neqn are language processors to assist in describing equations.
20       eqn is a preprocessor for troff(1) and is intended for devices that can
21       print   troff's  output.  neqn  is  a  preprocessor for nroff(1) and is
22       intended for use with terminals.  Usage is almost always:
23
24         example% eqn file ... | troff
25         example% neqn file ... | nroff
26
27
28
29
30       If no files are specified, eqn and neqn read from the standard input. A
31       line  beginning  with .EQ marks the start of an equation. The end of an
32       equation is marked by a line beginning with .EN. Neither of these lines
33       is  altered, so they may be defined in macro packages to get centering,
34       numbering, and so on.  It is also possible to  set  two  characters  as
35       ``delimiters'';  subsequent  text between delimiters is also treated as
36       eqn input.
37
38
39       checkeq reports missing or unbalanced delimiters and .EQ/.EN pairs.
40

OPTIONS

42       The following options are supported:
43
44       -dxy     Sets equation delimiters set to characters x and  y  with  the
45                command-line  argument. The more common way to do this is with
46                delim xy between .EQ and .EN. The left  and  right  delimiters
47                may  be  identical.  Delimiters  are  turned  off by delim off
48                appearing in the text. All text that is neither between delim‐
49                iters nor between .EQ and .EN is passed through untouched.
50
51
52       -fn      Changes  font to n globally in the document. The font can also
53                be changed globally in the body of the document by  using  the
54                gfont n directive, where n is the font specification.
55
56
57       -pn      Reduces  subscripts and superscripts by n point sizes from the
58                previous size.  In the absence of the  -p  option,  subscripts
59                and  superscripts are reduced by 3 point sizes from the previ‐
60                ous size.
61
62
63       -sn      Changes point size to n globally in the  document.  The  point
64                size  can also be changed globally in the body of the document
65                by using the gsize n directive, where  n is the point size.
66
67

OPERANDS

69       The following operands are supported:
70
71       file     The nroff or troff file processed by eqn or neqn.
72
73

EQN LANGUAGE

75       The nroff version of this description depicts the output  of   neqn  to
76       the  terminal  screen exactly as  neqn is able to display it. To see an
77       accurate depiction of the output, view  the  printed  version  of  this
78       page.
79
80
81       Tokens  within eqn are separated by braces, double quotes, tildes, cir‐
82       cumflexes, SPACE, TAB, or NEWLINE characters. Braces {}  are  used  for
83       grouping.  Generally speaking, anywhere a single character like x could
84       appear, a complicated construction  enclosed  in  braces  may  be  used
85       instead.  A  tilde (~) represents a full SPACE in the output; a circum‐
86       flex (^) half as much.
87
88       Subscripts and superscripts:
89
90           These are produced with the keywords sub and sup.
91
92           x sub i                      makes xi
93
94
95
96           a sub i sup 2                produces a2i
97
98
99
100           e sup {x sup 2 + y sup 2}    gives e^(x^2+y^2)
101
102
103
104
105       Fractions:
106
107           Fractions are made with over.
108
109           a over b     yields ab_
110
111
112
113
114       Square Roots:
115
116           These are made with sqrt
117
118           1 over sqrt {ax sup 2 +bx+c}
119
120               results in √_a_x_2_+_1b_x_+_c__
121
122
123
124
125       Limits:
126
127           The keywords from and to introduce lower and upper limits on  arbi‐
128           trary things:
129
130           lim from {n→ inf } sum from 0 to n x sub i
131
132                makes nl→i∞mn0Σxi
133
134
135
136
137       Brackets and Braces:
138
139           Left  and right brackets, braces, and the like, of the right height
140           are made with left and right.
141
142           left [ x sup 2 + y sup 2 over alpha right ] ~=~1
143
144               produces ⎡⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎣x2+y_2α_⎤⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎦=1
145
146
147               The right clause is optional.  Legal characters after left  and
148               right  are  braces,  brackets,  bars,  c  and f for ceiling and
149               floor, and "" for nothing at all (useful for a  right-side-only
150               bracket).
151
152
153
154       Vertical piles:
155
156           Vertical  piles  of  things  are made with  pile, lpile, cpile, and
157           rpile.
158                                                 a
159           pile {a above b above c}     produces b
160                                                 c
161
162
163                                       There can be  an  arbitrary  number  of
164                                       elements  in a pile.  lpile left-justi‐
165                                       fies, pile and cpile center, with  dif‐
166                                       ferent   vertical  spacing,  and  rpile
167                                       right justifies.
168
169
170
171       Matrices:
172
173           Matrices are made with matrix.
174
175           matrix { lcol { x sub i above y sub 2 } ccol { 1 above 2 } }
176
177               produces xi 1
178                        y2 2
179
180               In addition, there is rcol for a right-justified column.
181
182
183
184       Diacritical marks:
185
186           Diacritical marks are made with dot, dotdot, hat, tilde, bar,  vec,
187           dyad, and under.
188
189           x dot = f(t) bar             is ˙x=_f_(_t_)
190
191
192
193           y dotdot bar ~=~ n under     is _¨y=_n
194
195
196
197           x vec ~=~ y dyad            is →x=↔y
198
199
200
201
202       Sizes and Fonts:
203
204           Sizes  and  font  can  be  changed  with  size n or size ±n, roman,
205           italic, bold, and font n. Size and fonts can be changed globally in
206           a document by gsize n and gfont n, or by the command-line arguments
207           -sn and -fn.
208
209
210       Successive display arguments:
211
212           Successive display arguments can be lined up.   Place  mark  before
213           the desired lineup point in the first equation; place lineup at the
214           place that is to line up vertically in subsequent equations.
215
216
217       Shorthands:
218
219           Shorthands may be  defined  or  existing  keywords  redefined  with
220           define:
221
222           define thing % replacement %
223
224               Defines  a  new  token  called  thing which will be replaced by
225               replacement whenever it appears thereafter. The %  may  be  any
226               character that does not occur in replacement.
227
228
229
230       Keywords and Shorthands:
231
232           Keywords  like sum int inf and shorthands like >= → and != are rec‐
233           ognized.
234
235
236       Greek letters:
237
238           Greek letters are spelled out in the desired case, as in  alpha  or
239           GAMMA.
240
241
242       Mathematical words:
243
244           Mathematical words like  sin, cos, and  log are made Roman automat‐
245           ically.
246
247
248
249       troff(1) four-character escapes  like  ·  (·)  can  be  used  anywhere.
250       Strings  enclosed  in double quotes "..." are passed through untouched;
251       this permits keywords to be entered as text, and can be used to  commu‐
252       nicate with troff when all else fails.
253

ATTRIBUTES

255       See attributes(5) for descriptions of the following attributes:
256
257
258
259
260       ┌─────────────────────────────┬─────────────────────────────┐
261       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
262       ├─────────────────────────────┼─────────────────────────────┤
263       │Availability                 │SUNWdoc                      │
264       └─────────────────────────────┴─────────────────────────────┘
265

SEE ALSO

267       nroff(1), tbl(1), troff(1), attributes(5), ms(5)
268

BUGS

270       To embolden characters such as digits and parentheses, it  is necessary
271       to quote them, as in `bold "12.3"'.
272
273
274
275SunOS 5.11                        12 Jul 2002                           eqn(1)
Impressum