File:  [CSRG BSD Unix] / 42BSD / usr.lib / learn / eqn / L10.1a
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:54 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD42
BSD 4.2

#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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.