summaryrefslogtreecommitdiff
path: root/usr.bin/learn/lib/eqn/L10.1a
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/learn/lib/eqn/L10.1a')
-rw-r--r--usr.bin/learn/lib/eqn/L10.1a77
1 files changed, 77 insertions, 0 deletions
diff --git a/usr.bin/learn/lib/eqn/L10.1a b/usr.bin/learn/lib/eqn/L10.1a
new file mode 100644
index 00000000000..71423a98cea
--- /dev/null
+++ b/usr.bin/learn/lib/eqn/L10.1a
@@ -0,0 +1,77 @@
+#once #create message
+.ND
+.tr %$
+.EQ
+delim $$
+.EN
+.LP
+The next topic goes back to the problem of formatting
+equations on the page. Sometimes it is desirable to
+line up one part of an equation with some part
+of a previous equation - for example, equals signs
+are often lined up like this:
+.EQ I
+x mark = y sub i
+.EN
+.EQ I
+lineup = z sub i
+.EN
+.EQ I
+x sub i + y sub i lineup = z sub i
+.EN
+
+To achieve this, you have to do several things.
+(1) tell neqn to remember the place where things are
+to be lined up, which is done by saying
+"mark" just before the thing you want remembered:
+ .EQ I
+ x mark = y sub i
+ .EN
+.br
+(2) Then, in successive equations, telling neqn
+to line up something on the previous mark, with
+"lineup":
+ .EQ I
+ lineup = z sub i
+ .EN
+.br
+(3) You ____have __to use either ".EQ I" or ".EQ L";
+you can't line things up in a centered equation.
+
+For practice, modify "Example" so the
+equations are lined up on the equals signs, then
+type "ready".
+.pl 1
+#once #create Ref
+.LP
+A test of mark and lineup:
+.EQ I
+x sub i ~ mark =~ 1
+.EN
+.EQ I
+x sub i + y sub i ~ lineup = ~2
+.EN
+.pl 1
+#once #create Example
+.LP
+A test of mark and lineup:
+.EQ I
+x sub i ~ =~ 1
+.EN
+.EQ I
+x sub i + y sub i ~ =~ 2
+.EN
+.pl 1
+#
+#once neqn Ref | nroff >X1 &
+#once neqn message Ref | nroff -T$term %s/tinyms -
+#user
+neqn Example | nroff >X2
+#cmp X1 X2
+#fail
+Don't forget that tilde is a real character;
+put the mark and lineup after it.
+Remember .EQ I.
+#log
+#next
+10.1b 10