diff -urN eqn-v7-pure/Makefile eqn-v7-hacked/Makefile --- eqn-v7-pure/Makefile 1969-12-31 18:00:00.000000000 -0600 +++ eqn-v7-hacked/Makefile 2022-07-06 05:34:09.196687749 -0500 @@ -0,0 +1,21 @@ +# Set this macro to where your groff executable is located. For best +# results, ensure that it locates an s.tmac file with some fixes applied +# (Savannah #62686, #62687, #62688). +GROFF:=/home/branden/src/GIT/groff/build/test-groff +GROFFOPTS:=-ww -e -ms -M . -m sbtl -P -e -P -pletter -T pdf + +ALL=eqnsystem.pdf eqnuser.pdf + +all: $(ALL) + +EQNSYSTEMSRCS:=e.mac e0 e1 e2 e3 e4 e5 e6 e7 +EQNUSERSRCS:=g.mac g0 g1 g2 g3 g4 g5 + +eqnsystem.pdf: sbtl.tmac $(EQNSYSTEMSRCS) + $(GROFF) $(GROFFOPTS) $(EQNSYSTEMSRCS) >$@ + +eqnuser.pdf: sbtl.tmac $(EQNUSERSRCS) + $(GROFF) $(GROFFOPTS) $(EQNUSERSRCS) >$@ + +clean: + rm -f $(ALL) diff -urN eqn-v7-pure/e0 eqn-v7-hacked/e0 --- eqn-v7-pure/e0 2022-07-01 23:44:19.064152612 -0500 +++ eqn-v7-hacked/e0 2022-07-06 05:14:01.254315338 -0500 @@ -1,11 +1,11 @@ .nr PS 9 .nr VS 11 -....ND "Revised April, 1977" +.\"...ND "Revised April, 1977" .EQ delim $$ gsize 9 .EN -....TR 17 +.\"...TR 17 .TL A System for Typesetting Mathematics .AU diff -urN eqn-v7-pure/e1 eqn-v7-hacked/e1 --- eqn-v7-pure/e1 2022-07-01 23:44:19.064152612 -0500 +++ eqn-v7-hacked/e1 2022-07-06 05:09:20.715604554 -0500 @@ -20,8 +20,9 @@ is the multiplicity of characters, sizes, and fonts. An expression such as +.\" Added space before "->", GBR 2022 .EQ -lim from {x-> pi /2} ( tan~x) sup{sin~2x}~=~1 +lim from {x -> pi /2} ( tan~x) sup{sin~2x}~=~1 .EN requires an intimate mixture of roman, italic and greek letters, in three sizes, and a special character or two. diff -urN eqn-v7-pure/g.mac eqn-v7-hacked/g.mac --- eqn-v7-pure/g.mac 2022-06-30 16:28:19.984161912 -0500 +++ eqn-v7-hacked/g.mac 2022-07-01 11:44:16.157564585 -0500 @@ -2,6 +2,7 @@ .de SC .NH \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 +.pdfbookmark 1 \\$* .. .de UC \&\\$3\s-2\\$1\\s+2\\$2 diff -urN eqn-v7-pure/g0 eqn-v7-hacked/g0 --- eqn-v7-pure/g0 2022-06-30 18:38:30.234150358 -0500 +++ eqn-v7-hacked/g0 2022-07-08 19:19:39.087648085 -0500 @@ -1,9 +1,26 @@ +.\" Adapted for groff by G. Branden Robinson, 2022-06-30/07-02. Thanks +.\" to Deri James for PDF support. +.\" These values, used with URW Times fonts at 10 points, produce column +.\" and page breaks nearly identical to the C/A/T typeset original. +.nr LL 5.4i +.nr PO 1.55i +.\" Define a fake Bell System logo. +.char \[bs] \o'\[ci]|' .EQ delim $$ .EN -\".ND "June 2, 1976" -.RP -\".TM "76-1273-4 76-1271-4" 39199 39199-11 +. +.af year 0000 +.af mo 00 +.af dy 00 +.ND "August 15, 1978 \fI(retypeset with \fPgroff\fI\ + \n[year]-\n(mo-\n(dy)" +.RP no \" suppress repeat of document description on first body page +.\" Force page 1 to be numbered; it follows the cover page and the Unix +.\" Programmer's Manual page headings (which these sources don't produce +.\" anyway) are not appropriate for this document in isolation. +.nr pg*P1 1 +.\"TM "76-1273-4 76-1271-4" 39199 39199-11 .TL Typesetting Mathematics _ User's Guide \&\ \ \ \ \ (Second\ Edition) @@ -12,13 +29,18 @@ .AI .MH .AB -.in -.ll +.\" This document uses the full page width for the abstract. +.\"in +.\"ll +.nr 0:li 0 +.nr 0:ri 0 +.pdfinfo /Title Typesetting Mathematics - User's Guide (Second Edition) +.pdfinfo /Author Brian W. Kernighan and Lorinda L. Cherry .PP This is the user's guide for a system for typesetting mathematics, using -the phototypesetters on the +the \%photo\%typesetters on the .UX and .UC GCOS @@ -28,35 +50,42 @@ designed to be easy to use by people who know neither mathematics nor typesetting. Enough of the language to set in-line expressions like -$lim from {x-> pi /2} ( tan~x) sup{sin~2x}~=~1$ +.\" Correct missing space after n for GNU eqn. GBR, 2022. +$lim from {x -> pi /2} ( tan~x) sup{sin~2x}~=~1$ or display equations like -.in .5i +.\"in .5i .EQ I G(z)~mark =~ e sup { ln ~ G(z) } ~=~ exp left ( sum from k>=1 {S sub k z sup k} over k right ) ~=~ prod from k>=1 e sup {S sub k z sup k /k} .EN +.\" Use "cdots" for ellipses on the math axis; "ldots" on the baseline. +.\" Redefine them to space them more widely. Use ~ more generously than +.\" K&C; groff eqn tends to horizontally pack more tightly. Keep the +.\" copy of this in file "g4" in sync. .EQ I +define cdots "{ \[md]~\[md]~\[md] }" +define ldots "{ .~.~. }" lineup = left ( 1 + S sub 1 z + -{ S sub 1 sup 2 z sup 2 } over 2! + ... right ) -left ( 1+ { S sub 2 z sup 2 } over 2 +{ S sub 1 sup 2 z sup 2 } over 2! + ~ cdots right ) +~ left ( 1+ { S sub 2 z sup 2 } over 2 + { S sub 2 sup 2 z sup 4 } over { 2 sup 2 cdot 2! } -+ ... right ) ... ++ ~ cdots right ) ~ cdots .EN .EQ I lineup = sum from m>=0 left ( sum from -pile { k sub 1 ,k sub 2 ,..., k sub m >=0 +pile { k sub 1 ,k sub 2 , ~ ldots ~ , k sub m >=0 above -k sub 1 +2k sub 2 + ... +mk sub m =m} +k sub 1 +2k sub 2 + ~ cdots ~ +mk sub m =m} { S sub 1 sup {k sub 1} } over {1 sup k sub 1 k sub 1 ! } ~ { S sub 2 sup {k sub 2} } over {2 sup k sub 2 k sub 2 ! } ~ -... +cdots { S sub m sup {k sub m} } over {m sup k sub m k sub m ! } -right ) z sup m +right ) ~ z sup m .EN -.in 0 +.\"in 0 can be learned in an hour or so. .PP The language interfaces directly with @@ -73,11 +102,13 @@ .UC UNIX formatter .UC NROFF -to set mathematical expressions on +to set mathematical \%expressions on .UC DASI and .UC GSI terminals and Model 37 teletypes. +.\" TODO: Force the first body page to be numbered "2" to align with PDF +.\" page numbers. .AE -.CS 11 0 11 0 0 3 +.\"CS 11 0 11 0 0 3 diff -urN eqn-v7-pure/g1 eqn-v7-hacked/g1 --- eqn-v7-pure/g1 2022-06-30 16:28:19.984161912 -0500 +++ eqn-v7-hacked/g1 2022-07-01 20:39:52.463882265 -0500 @@ -1,3 +1,6 @@ +.\" Force extra-large blank area at top of page to match original. +.sp 10v +.nr MINGW 5.875n .if t .2C .SC Introduction .PP @@ -400,6 +403,7 @@ e sup {i omega t} .P2 is +.\" This equation got lost in the V7 Volume 2 manual! .EQ e sup {i omega t} .EN @@ -523,6 +527,7 @@ .EQ sqrt a+b + 1 over sqrt {ax sup 2 +bx+c} .EN +.KS Warning _ square roots of tall quantities look lousy, because a root-sign big enough to cover the quantity is @@ -534,6 +539,7 @@ .EQ sqrt{a sup 2 over b sub 2} .EN +.KE Big square roots are generally better written as something to the power \(12: .EQ @@ -603,6 +609,7 @@ lim from {n \(mi> inf} x sub n =0 .P2 is +.\" Correct missing space after n for GNU eqn. GBR, 2022. .EQ -lim from {n-> inf} x sub n =0 +lim from {n -> inf} x sub n =0 .EN diff -urN eqn-v7-pure/g2 eqn-v7-hacked/g2 --- eqn-v7-pure/g2 2022-06-30 16:28:19.984161912 -0500 +++ eqn-v7-hacked/g2 2022-06-30 22:42:34.436500637 -0500 @@ -181,9 +181,11 @@ is not subject to any of the font changes and spacing adjustments normally done by the equation setter. This provides a way to do your own spacing and adjusting if needed: +.KS .P1 italic "sin(x)" + sin (x) .P2 +.KE is .EQ italic "sin(x)" + sin (x) @@ -281,6 +283,7 @@ if at all possible. Thus, for example, you can say +.KS .P1 ^EQ I x+y mark = z @@ -296,6 +299,7 @@ .EQ I x lineup = 1 .EN +.KE For reasons too complicated to talk about, when you use .UC EQN @@ -428,11 +432,18 @@ right ] .P2 will make +.\" Cheat #1: AT&T eqn stacked piles more tightly than GNU eqn. .EQ +set baseline_sep 1v A ~=~ left [ pile { a above b above c } ~~ pile { x above y above z } right ] .EN +.\" Reset equation baseline separation to the default, which is not +.\" documented anywhere and has no syntactical access. :-/ +.EQ +set baseline_sep 140 +.EN The elements of the pile (there can be as many as you want) are centered one above another, at the right height for most purposes. @@ -466,6 +477,9 @@ .ul cpiles than it is for ordinary piles. +.\" Cheat #2: Shrink the display distance a bit to fit this display on +.\" the page. +.nr DD -0.25v .P1 2 roman sign (x)~=~ left { @@ -473,6 +487,7 @@ ~~ lpile {if~x>0 above if~x=0 above if~x<0} .P2 +.nr DD +0.25v makes .EQ roman sign (x)~=~ diff -urN eqn-v7-pure/g4 eqn-v7-hacked/g4 --- eqn-v7-pure/g4 2022-06-30 16:28:19.984161912 -0500 +++ eqn-v7-hacked/g4 2022-07-01 20:51:50.768616704 -0500 @@ -2,10 +2,10 @@ .PP Here is the complete source for the three display equations in the abstract of this guide. -.sp -.nf +.DS L .ps -2 .vs -2 +.\" Keep the copy of this in file "g0" in sync. .EQ I G(z)~mark =~ e sup { ln ~ G(z) } ~=~ exp left ( @@ -13,26 +13,27 @@ ~=~ prod from k>=1 e sup {S sub k z sup k /k} .EN .EQ I + define cdots "{ \[md]~\[md]~\[md] }" + define ldots "{ .~.~. }" lineup = left ( 1 + S sub 1 z + - { S sub 1 sup 2 z sup 2 } over 2! + ... right ) - left ( 1+ { S sub 2 z sup 2 } over 2 + { S sub 1 sup 2 z sup 2 } over 2! + ~ cdots right ) + ~ left ( 1+ { S sub 2 z sup 2 } over 2 + { S sub 2 sup 2 z sup 4 } over { 2 sup 2 cdot 2! } - + ... right ) ... + + ~ cdots right ) ~ cdots .EN .EQ I lineup = sum from m>=0 left ( sum from - pile { k sub 1 ,k sub 2 ,..., k sub m >=0 + pile { k sub 1 ,k sub 2 , ~ ldots ~ , k sub m >=0 above - k sub 1 +2k sub 2 + ... +mk sub m =m} + k sub 1 +2k sub 2 + ~ cdots ~ +mk sub m =m} { S sub 1 sup {k sub 1} } over {1 sup k sub 1 k sub 1 ! } ~ { S sub 2 sup {k sub 2} } over {2 sup k sub 2 k sub 2 ! } ~ - ... + cdots { S sub m sup {k sub m} } over {m sup k sub m k sub m ! } - right ) z sup m + right ) ~ z sup m .EN -.sp -.fi +.DE .ps +2 .vs +2 .SC "Keywords, Precedences, Etc." @@ -61,7 +62,7 @@ Digits, parentheses, brackets, punctuation marks, and these mathematical words are converted to Roman font when encountered: -.P1 +.P1 3 \" reduce indentation, GBR 2022 sin cos tan sinh cosh tanh arc max min lim log ln exp Re Im and if for det @@ -140,7 +141,7 @@ .sp .nf .in .2i -.ta .7i 1.4i 2.1i +.ta .7i 1.4i 2.0i \" reduce last tab stop, GBR 2022 above 17, 18 lpile 17 back 21 mark 15 bar 13 matrix 18 diff -urN eqn-v7-pure/sbtl.tmac eqn-v7-hacked/sbtl.tmac --- eqn-v7-pure/sbtl.tmac 1969-12-31 18:00:00.000000000 -0600 +++ eqn-v7-hacked/sbtl.tmac 2022-06-30 21:04:56.846814044 -0500 @@ -0,0 +1,15 @@ +.de MH +Bell Laboratories +Murray Hill, New Jersey 07974 +.. +.de UX +.nr btl*seen-UX-macro 0 +.ds btl*UX-suffix \(dg\" +\s[\\n[.s]*8u/10u]UNIX\s0\\$1\\*[btl*UX-suffix] +.if !\\n[btl*seen-UX-macro] \{\ +. FS \\*[btl*UX-suffix] +. nop UNIX is a Trademark of Bell Laboratories.\" sic +. FE +. nr btl*seen-UX-macro 1 +.\} +..