BSD 3 development
[unix-history] / usr / lib / learn / eqn / L6.1a
CommitLineData
fd15fd37
BJ
1#once #create message
2.ND
3.tr %$
4.EQ
5delim $$
6.EN
7.LP
8So far every equation you have typed in
9has been "displayed" - neatly centered or indented, and
10offset from the surrounding text.
11But not all equations are like that.
12Very often they appear right in the middle of
13running text as subscripts like $x sub i$ or special characters
14like $pi$ or $partial$. How are these done?
15
16The idea is this. Two characters (which may be identical)
17are set aside as "delimiters". When the
18left delimiter is seen anywhere in ___\b\b\bany line,
19it marks the beginning of an in-line equation.
20The end is marked by the right delimiter. Between the
21delimiters, all the normal rules of neqn apply.
22
23Suppose we say the delimiters are % signs.
24Then to get $pi$, you have to type %pi%.
25
26To make sure that you can do this much, find the
27$pi$, $alpha$ and $sum$ characters in "Example"
28and make them into in-line equations.
29Use % and % as the delimiter characters.
30(This is the most frequent choice, by the way.)
31Type "ready" when you're done.
32.pl 1
33#once #create Ref
34.EQ
35delim $$
36.EN
37.LP
38This line contains some $pi$ and $alpha$ Greek
39and $sum$ as well. Don't forget that spaces
40inside dollar signs are ignored, while spaces
41outside them are significant.
42.pl 1
43#once #create Example
44.EQ
45delim $$
46.EN
47.LP
48This line contains some pi and alpha Greek
49and sum as well. Don't forget that spaces
50inside dollar signs are ignored, while spaces
51outside them are significant.
52.pl 1
53#once neqn Ref | nroff >X1 &
54#once neqn message Ref | nroff -T$term %s/tinyms -
55#user
56neqn Example | nroff >X2
57#cmp X1 X2
58#log
59#next
606.1b