diff --git a/src/Makefile b/src/Makefile index ae188b3..0f290a7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -15,14 +15,14 @@ ch06.t ch07.t ch08.t ch09.t ch10.t ch11.t ch12.t ch13.t ch14.t \ ch15.t ch16.t ch17.t ch18.t appa.t appb.t appc.t appd.t appe.t \ appf.t appg.t -utp_book.ps: toc.t utp_ix.t - $(GROFF) -step -ms -rRef=0 utp_book.t >$@.tmp +utp_book.ps: toc.t utp_ix.t utp.mac + $(GROFF) -b -step -ms -rRef=0 utp_book.t >$@.tmp mv $@.tmp $@ clean:: rm -f utp_book.ps utp_book.ps.tmp -toc.t: $(CHAPTERS) +toc.t: $(CHAPTERS) utp.mac $(GROFF) -step -ms -rRef=1 ix.macro utp_book.t >/dev/null 2>utp.aux.tmp mv utp.aux.tmp utp.aux $(AWK) -f toc.awk utp.aux >$@.tmp diff --git a/src/appa.t b/src/appa.t index 876dd7f..9d9ae74 100644 --- a/src/appa.t +++ b/src/appa.t @@ -522,10 +522,10 @@ command. .\" larger, for readability and to match the paper UTP. .\" /Andreas 2002-10-21 .TS -tab(#), expand; -cbw(1i) 2 L 2 cbw(1.2i) 2 L 2 cbw(6i-3i) +tab(#); +cbw(1i) 2 L 2 cbw(1.2i) 2 L 2 cb cb L cb L cb -LfCW L CfCW L L. +LfCW L CfCW L Lx. Option (Abbreviation)##Default##Description _##_##_ @@ -1126,8 +1126,8 @@ Ahead or back to line matching .\" The list below need larger space between items. .\" /Andreas 2002-10-21 .TS -tab(#), expand; -lfCW lw(4i). +tab(#); +lfCW lx. abbrev#T{ .CW ab[\c .I "string text"\c diff --git a/src/appb.t b/src/appb.t index 21b87c7..1a8bf60 100644 --- a/src/appb.t +++ b/src/appb.t @@ -2416,5 +2416,3 @@ l:n:l:l:n. .TE .poE .ix %end [pic] preprocessor, summary~of command~characters %key pic preprocessor, summary of command~characters - - diff --git a/src/appg.t b/src/appg.t index 70efdb3..069978b 100644 --- a/src/appg.t +++ b/src/appg.t @@ -53,4 +53,3 @@ A concise but thorough description of the UNIX .CW make utility. (63 pp.) - diff --git a/src/ch01.t b/src/ch01.t index f2cfa37..724b3b5 100644 --- a/src/ch01.t +++ b/src/ch01.t @@ -1048,4 +1048,3 @@ it can let you do just what a word processor does. In many more instances, it lets you use more of the computer to do things that a word processor either can't do or can't do very well. - diff --git a/src/ch02.t b/src/ch02.t index da0bfde..cb382d4 100644 --- a/src/ch02.t +++ b/src/ch02.t @@ -1191,4 +1191,3 @@ for users of the UNIX system\c \(em\c the mechanism by which all the other tools can be made to work together. - diff --git a/src/ch03.t b/src/ch03.t index 0b8657c..69ac0cf 100644 --- a/src/ch03.t +++ b/src/ch03.t @@ -1,4 +1,3 @@ - .ig ch03.t Typed by: Heinz-Jürgen Oertel diff --git a/src/ch05.t b/src/ch05.t index ba54bbf..baed6a7 100644 --- a/src/ch05.t +++ b/src/ch05.t @@ -2258,4 +2258,3 @@ Many of these features are covered in Chapters 14 through 18, where, for example, we show macros for formatting numbered lists. .ix %end [ms] macros %key ms macros .\" end of chapter 5 - diff --git a/src/ch06.t b/src/ch06.t index 62ee435..3666504 100644 --- a/src/ch06.t +++ b/src/ch06.t @@ -4591,4 +4591,3 @@ In Chapter 14, you will learn about writing macro definitions, which should give you the information you need to write these supplementary \(lquser exit macros.\(rq - diff --git a/src/ch07.t b/src/ch07.t index 6d4a882..e5373be 100644 --- a/src/ch07.t +++ b/src/ch07.t @@ -1,5 +1,3 @@ - - .ig Typed up by: Heinz-Jürgen Oertel Marked up by: Heinz-Jürgen Oertel @@ -2862,4 +2860,3 @@ because you can store the commands in named buffers and access them in any file you edit. .ix %end [ex] editor %key ex editor .ix %end [vi] editor %key vi editor - diff --git a/src/ch08.t b/src/ch08.t index ae7ed19..fdfab6d 100644 --- a/src/ch08.t +++ b/src/ch08.t @@ -2353,4 +2353,3 @@ Assets\\a@41,645.8@34,434.7@32,876.6@27,987.6 .Pe .Fe " Input for Figure 8-3" .ix %end [tbl] preprocessor %key tbl preprocessor - diff --git a/src/ch09.t b/src/ch09.t index 9528927..3051586 100644 --- a/src/ch09.t +++ b/src/ch09.t @@ -1,4 +1,3 @@ - .ig Typed by: Michael Hobgood Marked up by: Michael Hobgood diff --git a/src/ch10.t b/src/ch10.t index eb8f1f3..20563b0 100644 --- a/src/ch10.t +++ b/src/ch10.t @@ -1,10 +1,8 @@ - .ig Typed by: Michael Hobgood Marked up by: Michael Hobgood Proofed on: 17 Oct 2002 .. - .so utp.mac .utp .ig diff --git a/src/ch11.t b/src/ch11.t index 0a02c3d..a774350 100644 --- a/src/ch11.t +++ b/src/ch11.t @@ -4236,5 +4236,3 @@ using Keeping a script of a procedure is also a good start for building a shell script that performs a routine task automatically. - - diff --git a/src/ch12.t b/src/ch12.t index c83f599..2f01db9 100644 --- a/src/ch12.t +++ b/src/ch12.t @@ -3162,16 +3162,16 @@ selections a user would select to reach a given command. For example: .LP .in 5n -.BX "\s-2M\s0"\c +.BX \s-2M\s0 ain menu .in +5n -.BX "\s-2P\s0"\c +.BX \s-2P\s0 ortfolio commands .in +5n -.BX "\s-2E\s0"\c +.BX \s-2E\s0 valuate portfolios .in +5n -.BX "\s-2S\s0"\c +.BX \s-2S\s0 hock factors .in 0 .PP @@ -3211,6 +3211,12 @@ aside: The .CW \ec escape sequence brings text from the following line onto the current line. +.\" XXX: Not _exactly_. No forward scanning is performed. When +.\" filling, `\c` instructs the formatter to suppress the word space +.\" that an input line break normally places on the output. When not +.\" filling, it suppresses the _line_ break and input line break +.\" the formatter normally places on the output. +.\" --GBR, 2024-10-08 You would use this, for example, when you don't want the argument to a macro to be separated from the first word on the next line by the space @@ -3219,7 +3225,18 @@ The fact that the .CW .BX macro already makes provision for this case, and allows you to supply continued text in a second optional -argument, is somewhat irrelevant to this example. +argument, +.\" XXX: Eh? What version of ms did this? Just considering formatters +.\" extant circa 1987 when UTP was written, V6 Unix didn't. V7 Unix +.\" didn't. 4.2BSD didn't. 4.3BSD didn't. DWB 3.3 (which was later, +.\" 1993 or so, but is all we have) didn't. +.\" --GBR, 2024-10-08 +.\" https://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/lib/tmac.s +.\" https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/lib/tmac/tmac.s +.\" https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/lib/tmac/tmac.s +.\" https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.3BSD/usr/lib/tmac/tmac.s +.\" https://github.com/n-t-roff/DWB3.3/blob/master/macros/ms/tmac.s.sr +is somewhat irrelevant to this example. The files had been coded as shown here, the mistake had been made, and there were hundreds, perhaps thousands, of instances to correct). diff --git a/src/ch15.t b/src/ch15.t index 1966e61..42cfa14 100644 --- a/src/ch15.t +++ b/src/ch15.t @@ -386,8 +386,8 @@ Table \\$1: \\$2 . \" left or right margin depending on whether if falls on . \" an odd or even page, if you change something prior to . \" calling this, it might shift sides on you. -.if e .tl '\b:\\$1:''' -.if o .tl '''\b:\\$1:' +.if e .tl '\b@\\$1@''' +.if o .tl '''\b@\\$1@' .lt -.5i .po +.25i .cs B @@ -1927,7 +1927,7 @@ drawing command as if it were a separate word. .page 459 .RS .TS -lf(CW) lw(4.5i). +lf(CW) lx. T{ \\v'-.25i'\\c T} T{ diff --git a/src/toc.awk b/src/toc.awk index 3b27515..da90f0c 100755 --- a/src/toc.awk +++ b/src/toc.awk @@ -14,16 +14,16 @@ BEGIN { /^Se:/ { if ( $4 == "Contents" ) next; - gsub(/\\f\(CW/, "\\f\(CB" ); - gsub(/\\f\[CW\]/, "\\f\[CB\]" ); - gsub(/\\fC/, "\\f\[CB\]" ); + gsub(/\\f\(CW/, "\\f(CB" ); + gsub(/\\f\[CW\]/, "\\f[CB]" ); + gsub(/\\fC/, "\\f[CB]" ); print ".ps 12\n.sp"; print $3"\\h'|.25i'\\fB"$4"\\fR "$2; print ".ps 10\n.sp"; } /^Ah:/ { - gsub(/\\f\(CB/, "\\f\(CW" ); - gsub(/\\f\[CB\]/, "\\f\[CW\]" ); + gsub(/\\f\(CB/, "\\f(CW" ); + gsub(/\\f\[CB\]/, "\\f[CW]" ); print "\\h'|.25i'"$3""$2; } # default (skip index entries) diff --git a/src/utp.mac b/src/utp.mac index 889d924..437c2ec 100644 --- a/src/utp.mac +++ b/src/utp.mac @@ -10,6 +10,9 @@ book available again. Version of 16 November 2002 .. +.ftr C CR +.ftr CW CR +.ftr H HR .RT .nr nH 0 \" don't number [ABCD]-heads .nr gE 0 \" don't add chapter number to [ABCD]-heads @@ -157,10 +160,7 @@ Version of 16 November 2002 .de Se \" Section. $1: number, $2: name . \" $3: type (Chapter, Appendix, ...) . \" $4: non-null => don't map to uppercase -.if e \{\ -\& -.bp -.\} +.if e .bp .ds chapter_name \\$2 .ie !'\\$1'' \{. \" If we have a section number . ds chapter_head \\$1 @@ -201,8 +201,6 @@ Version of 16 November 2002 . \" Might be Preface, etc. so no error diag. .\} .nr chapter_page2 1 \" Next page starts a chapter, so no header -.if \\n[%]>1 .bp -.nr PN \\n[%] .ie '\\$3'NONE' .af PN i .el .af PN 1 .nr chapter_page 1 \" This page starts a chapter, number at bottom @@ -255,12 +253,12 @@ Version of 16 November 2002 .\} .el .ds chapter_type Chapter .\" If there is a section number, output Type and section number -.if !'\\$1'' \s14\fB\\*[chapter_type] \\$1\fP\s0 +.if !'\\$1'' \s(14\fB\\*[chapter_type] \\$1\fP\s0 .\" If there is no section number, but there is a type, then ouput it -.if '\\$1'' .if !'\\$3'' \s14\fB\\*[chapter_type]\fP\s0 +.if '\\$1'' .if !'\\$3'' \s(14\fB\\*[chapter_type]\fP\s0 .sp 5p .\" Print the section title if there is one -\#.if !'\\$2'' \s14\fB\\$2\fP\s0 +\#.if !'\\$2'' \s(14\fB\\$2\fP\s0 .if !'\\$2'' \{\ .ps 14 .B @@ -637,7 +635,6 @@ Version of 16 November 2002 \# .de utp_top .ev header_footer -.nr PN \\n[%] .if !\\n[chapter_page2] \{. \" if this page doesn't start a chapter . ie o .tl ''\\*[chapter_name]'\\n[PN]' . el .tl '\\n[PN]'\*[square] Unix Text Processing \*[square]''