History

CWEB — Release 3.61, 2000-07-26.

Andreas Scherer committed 15 years ago

Commit bf39f291 parent 16047cf21 files · +117 −92Browse files

Unified · Split

21 files
  1. Makefile +16 −5
  2. README +2 −2
  3. comm-man.ch +1 −1
  4. comm-ql.ch +4 −4
  5. common.w +5 −5
  6. ctang-bs.ch +2 −2
  7. ctang-man.ch +1 −1
  8. ctang-pc.ch +2 −2
  9. ctang-ql.ch +4 −4
  10. ctang-vms.ch +2 −2
  11. ctangle.c +1 −1
  12. ctangle.w +6 −6
  13. cweav-bs.ch +2 −2
  14. cweav-man.ch +1 −1
  15. cweav-pc.ch +2 −2
  16. cweav-ql.ch +4 −4
  17. cweav-vms.ch +2 −2
  18. cweave.w +8 −7
  19. cweb.el +1 −10
  20. cwebmac.tex +44 −25
  21. cwebman.tex +7 −4
Makefile+16−5
@@ -1,8 +1,8 @@
11 # This file is part of CWEB.
22 # It is distributed WITHOUT ANY WARRANTY, express or implied.
3−# Version 3.0 --- June 1993
3+# Version 3.61 --- July 2000
44
5−# Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
5+# Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
66
77 # Permission is granted to make and distribute verbatim copies of this
88 # document provided that the copyright notice and this permission notice
@@ -62,6 +62,10 @@ CC = cc · 53 unmodified lines
6262 RM= /bin/rm
6363 CP= /bin/cp
6464
65+# uncomment the second line if you use pdftex to bypass .dvi files
66+PDFTEX = dvipdfm
67+#PDFTEX = pdftex
68+
6569 ########## You shouldn't have to change anything after this point #######
6670
6771 CWEAVE = ./cweave
@@ -97,8 +101,10 @@ ALL = common.w ctangle.w cweave.w prod.w \ · 29 unmodified lines
97101
98102 .w.pdf:
99103 make $*.tex
100− tex "\let\pdf+ \input $*"
101− dvipdfm $*
104+ case "$(PDFTEX)" in \
105+ dvipdfm ) tex "\let\pdf+ \input $*"; dvipdfm $* ;; \
106+ pdftex ) pdftex $* ;; \
107+ esac
102108
103109 all: ctangle cweave
104110
@@ -153,19 +159,24 @@ fullmanual: usermanual $(SOURCES) comm-man.ch ctang-man.ch cweav-man.ch · 48 unmodified lines
153159 # be sure to leave ctangle.c and common.c for bootstrapping
154160 clean:
155161 $(RM) -f -r *~ *.o common.tex cweave.tex cweave.c ctangle.tex \
156− *.log *.dvi *.toc *.idx *.scn core cweave.w.[12] cweave ctangle
162+ *.log *.dvi *.toc *.idx *.scn *.pdf core cweave ctangle
157163
158164 install: all
165+ - mkdir $(DESTDIR)
159166 $(CP) cweave $(DESTDIR)$(DESTPREF)weave
160167 chmod 755 $(DESTDIR)$(DESTPREF)weave
161168 $(CP) ctangle $(DESTDIR)$(DESTPREF)tangle
162169 chmod 755 $(DESTDIR)$(DESTPREF)tangle
170+ - mkdir $(MANDIR)
163171 $(CP) cweb.1 $(MANDIR)/cweb.$(MANEXT)
164172 chmod 644 $(MANDIR)/cweb.$(MANEXT)
173+ - mkdir $(MACROSDIR)
165174 $(CP) cwebmac.tex $(MACROSDIR)
166175 chmod 644 $(MACROSDIR)/cwebmac.tex
176+ - mkdir $(EMACSDIR)
167177 $(CP) cweb.el $(EMACSDIR)
168178 chmod 644 $(EMACSDIR)/cweb.el
179+ - mkdir $(CWEBINPUTS)
169180 $(CP) c++lib.w $(CWEBINPUTS)
170181 chmod 644 $(CWEBINPUTS)/c++lib.w
171182
README+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 % They are distributed WITHOUT ANY WARRANTY, express or implied.
44 % This README file last updated May 2000 by Don Knuth
55
6−% Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
6+% Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
77
88 % Permission is granted to make and distribute verbatim copies of this
99 % document provided that the copyright notice and this permission notice
@@ -58,7 +58,7 @@ The files common.c and ctangle.c are used for bootstrapping. · 48 unmodified lines
5858 The file cweb.1 is a manual page.
5959 The file cweb.el is suggested for GNU-Emacs users.
6060 The file c++lib.w is for C++ users (say `@i c++lib.w' at beginning of program).
61−The files *-man.ch are used if you want to make the full 234-page CWEB manual.
61+The files *-man.ch are used if you want to make the full 236-page CWEB manual.
6262 The files *-bs.ch are used instead of *-pc.ch if you are doing BIG programs.
6363 You can use makefile.bs to make CWEB with *-bs.ch.
6464 The files *-ql.ch are for QDOS/SMSQ systems; see readme.ql for further info.
comm-man.ch+1−1
@@ -2,7 +2,7 @@ Change file to help make Appendix D of the full CWEB manual · 1 unmodified line
22 @x
33 \def\botofcontents{\vfill
44 \noindent
5−Copyright \copyright\ 1987, 1990, 1993 Silvio Levy and Donald E. Knuth
5+Copyright \copyright\ 1987, 1990, 1993, 2000 Silvio Levy and Donald E. Knuth
66 \bigskip\noindent
77 Permission is granted to make and distribute verbatim copies of this
88 document provided that the copyright notice and this permission notice
comm-ql.ch+4−4
@@ -10,24 +10,24 @@ ex <dev_>cc;'-v -h -c -=500000 -DCWEBINPUTS=flp2_ common_c' · 9 unmodified lines
1010 @x
1111 \def\v{\char'174} % vertical (|) in typewriter font
1212
13−\def\title{Common code for CTANGLE and CWEAVE (Version 3.6)}
13+\def\title{Common code for CTANGLE and CWEAVE (Version 3.61)}
1414 \def\topofcontents{\null\vfill
1515 \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and
1616 {\ttitlefont CWEAVE}}
1717 \vskip 15pt
18− \centerline{(Version 3.6)}
18+ \centerline{(Version 3.61)}
1919 \vfill}
2020 \def\botofcontents{\vfill
2121 \noindent
2222 @y
2323 \def\v{\char'174} % vertical (|) in typewriter font
2424
25−\def\title{Common code for CTANGLE and CWEAVE (QL Version 3.6)}
25+\def\title{Common code for CTANGLE and CWEAVE (QL Version 3.61)}
2626 \def\topofcontents{\null\vfill
2727 \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and
2828 {\ttitlefont CWEAVE}}
2929 \vskip 15pt
30− \centerline{(Version 3.6)}
30+ \centerline{(Version 3.61)}
3131 \vfill}
3232 \def\botofcontents{\vfill
3333 \noindent
common.w+5−5
@@ -2,9 +2,9 @@ · 1 unmodified line
22 % This program by Silvio Levy and Donald E. Knuth
33 % is based on a program by Knuth.
44 % It is distributed WITHOUT ANY WARRANTY, express or implied.
5−% Version 3.6 --- May 2000 (works with later versions too)
5+% Version 3.61 --- July 2000 (works with later versions too)
66
7−% Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
7+% Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
88
99 % Permission is granted to make and distribute verbatim copies of this
1010 % document provided that the copyright notice and this permission notice
@@ -17,16 +17,16 @@ · 6 unmodified lines
1717
1818 \def\v{\char'174} % vertical (|) in typewriter font
1919
20−\def\title{Common code for CTANGLE and CWEAVE (Version 3.6)}
20+\def\title{Common code for CTANGLE and CWEAVE (Version 3.61)}
2121 \def\topofcontents{\null\vfill
2222 \centerline{\titlefont Common code for {\ttitlefont CTANGLE} and
2323 {\ttitlefont CWEAVE}}
2424 \vskip 15pt
25− \centerline{(Version 3.6)}
25+ \centerline{(Version 3.61)}
2626 \vfill}
2727 \def\botofcontents{\vfill
2828 \noindent
29−Copyright \copyright\ 1987, 1990, 1993 Silvio Levy and Donald E. Knuth
29+Copyright \copyright\ 1987, 1990, 1993, 2000 Silvio Levy and Donald E. Knuth
3030 \bigskip\noindent
3131 Permission is granted to make and distribute verbatim copies of this
3232 document provided that the copyright notice and this permission notice
ctang-bs.ch+2−2
@@ -17,12 +17,12 @@ by using "huge" pointers. · 16 unmodified lines
1717 The ``banner line'' defined here should be changed whenever \.{CTANGLE}
1818 is modified.
1919
20−@d banner "This is CTANGLE (Version 3.6)\n"
20+@d banner "This is CTANGLE (Version 3.61)\n"
2121 @y
2222 The ``banner line'' defined here should be changed whenever \.{CTANGLE}
2323 is modified.
2424
25−@d banner "This is CTANGLE (Version 3.6pc/big)\n"
25+@d banner "This is CTANGLE (Version 3.61pc/big)\n"
2626 @z
2727
2828
ctang-man.ch+1−1
@@ -2,7 +2,7 @@ Change file to help make Appendix E of the full CWEB manual · 1 unmodified line
22 @x
33 \def\botofcontents{\vfill
44 \noindent
5−Copyright \copyright\ 1987, 1990, 1993 Silvio Levy and Donald E. Knuth
5+Copyright \copyright\ 1987, 1990, 1993, 2000 Silvio Levy and Donald E. Knuth
66 \bigskip\noindent
77 Permission is granted to make and distribute verbatim copies of this
88 document provided that the copyright notice and this permission notice
ctang-pc.ch+2−2
@@ -9,9 +9,9 @@ that allows >64K arrays. If you need lots of bytes and toks, try the · 8 unmodified lines
99 alternate change files with -bs suffix instead of -pc.
1010
1111 @x section 1
12−@d banner "This is CTANGLE (Version 3.6)\n"
12+@d banner "This is CTANGLE (Version 3.61)\n"
1313 @y
14−@d banner "This is CTANGLE (Version 3.6pc)\n"
14+@d banner "This is CTANGLE (Version 3.61pc)\n"
1515 @z
1616 @x section 4
1717 @d max_bytes 90000 /* the number of bytes in identifiers,
ctang-ql.ch+4−4
@@ -7,15 +7,15 @@ ex <dev_>cc;"-v -h -c -=500000 ctangle_c" · 6 unmodified lines
77
88
99 @x
10−\def\title{CTANGLE (Version 3.6)}
10+\def\title{CTANGLE (Version 3.61)}
1111 @y
12−\def\title{CTANGLE (QL Version 3.6)}
12+\def\title{CTANGLE (QL Version 3.61)}
1313 @z
1414
1515 @x section 1
16−@d banner "This is CTANGLE (Version 3.6)\n"
16+@d banner "This is CTANGLE (Version 3.61)\n"
1717 @y
18−@d banner "This is CTANGLE (QL Version 3.6)\n"
18+@d banner "This is CTANGLE (QL Version 3.61)\n"
1919 @z
2020
2121 @x
ctang-vms.ch+2−2
@@ -10,9 +10,9 @@ created: · 9 unmodified lines
1010 (these changes not necessary for initial bootstrapping)
1111
1212 @x section 1 (01-FEB-1992 ST)
13−@d banner "This is CTANGLE (Version 3.6)\n"
13+@d banner "This is CTANGLE (Version 3.61)\n"
1414 @y
15−@d banner "This is CTANGLE (VAX/VMS Version 3.6)\n"
15+@d banner "This is CTANGLE (VAX/VMS Version 3.61)\n"
1616 @z
1717
1818 @x section 6 (from common.h) (01-FEB-1992 ST)
ctangle.c+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515 /*:62*/
1616 #line 64 "ctangle.w"
1717
18−#define banner "This is CTANGLE (Version 3.6)\n" \
18+#define banner "This is CTANGLE (Version 3.61)\n" \
1919
2020 #define max_bytes 90000 \
2121
ctangle.w+6−6
@@ -2,10 +2,10 @@ · 1 unmodified line
22 % This program by Silvio Levy and Donald E. Knuth
33 % is based on a program by Knuth.
44 % It is distributed WITHOUT ANY WARRANTY, express or implied.
5−% Version 3.6 --- May 2000
5+% Version 3.61 --- July 2000
66 % (same as Version 3.5 except for minor typographic/stylistic corrections)
77
8−% Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
8+% Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
99
1010 % Permission is granted to make and distribute verbatim copies of this
1111 % document provided that the copyright notice and this permission notice
@@ -23,15 +23,15 @@ · 11 unmodified lines
2323 \mathchardef\RA="3221 % right arrow
2424 \mathchardef\BA="3224 % double arrow
2525
26−\def\title{CTANGLE (Version 3.6)}
26+\def\title{CTANGLE (Version 3.61)}
2727 \def\topofcontents{\null\vfill
2828 \centerline{\titlefont The {\ttitlefont CTANGLE} processor}
2929 \vskip 15pt
30− \centerline{(Version 3.6)}
30+ \centerline{(Version 3.61)}
3131 \vfill}
3232 \def\botofcontents{\vfill
3333 \noindent
34−Copyright \copyright\ 1987, 1990, 1993 Silvio Levy and Donald E. Knuth
34+Copyright \copyright\ 1987, 1990, 1993, 2000 Silvio Levy and Donald E. Knuth
3535 \bigskip\noindent
3636 Permission is granted to make and distribute verbatim copies of this
3737 document provided that the copyright notice and this permission notice
@@ -58,7 +58,7 @@ Joachim Schrod, Lee Wittenberg, and others who have contributed improvements. · 20 unmodified lines
5858 The ``banner line'' defined here should be changed whenever \.{CTANGLE}
5959 is modified.
6060
61−@d banner "This is CTANGLE (Version 3.6)\n"
61+@d banner "This is CTANGLE (Version 3.61)\n"
6262
6363 @c
6464 @<Include files@>@/
cweav-bs.ch+2−2
@@ -20,12 +20,12 @@ This file contributed by Barry Schwartz, trashman@crud.mn.org, 28 Jun 94. · 19 unmodified lines
2020 The ``banner line'' defined here should be changed whenever \.{CWEAVE}
2121 is modified.
2222
23−@d banner "This is CWEAVE (Version 3.6)\n"
23+@d banner "This is CWEAVE (Version 3.61)\n"
2424 @y
2525 The ``banner line'' defined here should be changed whenever \.{CWEAVE}
2626 is modified.
2727
28−@d banner "This is CWEAVE (Version 3.6pc/big)\n"
28+@d banner "This is CWEAVE (Version 3.61pc/big)\n"
2929 @z
3030
3131
cweav-man.ch+1−1
@@ -2,7 +2,7 @@ Change file to help make Appendix F of the full CWEB manual · 1 unmodified line
22 @x
33 \def\botofcontents{\vfill
44 \noindent
5−Copyright \copyright\ 1987, 1990, 1993 Silvio Levy and Donald E. Knuth
5+Copyright \copyright\ 1987, 1990, 1993, 2000 Silvio Levy and Donald E. Knuth
66 \bigskip\noindent
77 Permission is granted to make and distribute verbatim copies of this
88 document provided that the copyright notice and this permission notice
cweav-pc.ch+2−2
@@ -11,9 +11,9 @@ that allows >64K arrays. (If you need lots more bytes, try the alternate · 10 unmodified lines
1111 change files that have -bs in their name instead of -pc.)
1212
1313 @x section 1
14−@d banner "This is CWEAVE (Version 3.6)\n"
14+@d banner "This is CWEAVE (Version 3.61)\n"
1515 @y
16−@d banner "This is CWEAVE (Version 3.6pc)\n"
16+@d banner "This is CWEAVE (Version 3.61pc)\n"
1717 @z
1818
1919 @x section 4
cweav-ql.ch+4−4
@@ -7,15 +7,15 @@ ex <dev_>cc;"-v -h -c =500000 cweave_c" · 6 unmodified lines
77
88
99 @x
10−\def\title{CWEAVE (Version 3.6)}
10+\def\title{CWEAVE (Version 3.61)}
1111 @y
12−\def\title{CWEAVE (QL Version 3.6)}
12+\def\title{CWEAVE (QL Version 3.61)}
1313 @z
1414
1515 @x section 1
16−@d banner "This is CWEAVE (Version 3.6)\n"
16+@d banner "This is CWEAVE (Version 3.61)\n"
1717 @y
18−@d banner "This is CWEAVE (QL Version 3.6)\n"
18+@d banner "This is CWEAVE (QL Version 3.61)\n"
1919 @z
2020
2121 @x
cweav-vms.ch+2−2
@@ -13,9 +13,9 @@ modified: · 12 unmodified lines
1313 (also modified by Don Knuth to keep version numbers uptodate)
1414
1515 @x section 1 (01-FEB-1992 ST)
16−@d banner "This is CWEAVE (Version 3.6)\n"
16+@d banner "This is CWEAVE (Version 3.61)\n"
1717 @y
18−@d banner "This is CWEAVE (VAX/VMS Version 3.6)\n"
18+@d banner "This is CWEAVE (VAX/VMS Version 3.61)\n"
1919 @z
2020
2121 @x section 6 (from common.h) (01-FEB-1992 ST)
cweave.w+8−7
@@ -2,10 +2,11 @@ · 1 unmodified line
22 % This program by Silvio Levy and Donald E. Knuth
33 % is based on a program by Knuth.
44 % It is distributed WITHOUT ANY WARRANTY, express or implied.
5−% Version 3.6 --- May 2000
6−% (adds recently introduced features of standard C++ to version 3.4)
5+% Version 3.61 --- July 2000
6+% (essentially the same as version 3.6, which added
7+% recently introduced features of standard C++ to version 3.4)
78
8−% Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
9+% Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
910
1011 % Permission is granted to make and distribute verbatim copies of this
1112 % document provided that the copyright notice and this permission notice
@@ -28,15 +29,15 @@ · 16 unmodified lines
2829 \def\skipxTeX{\\{skip\_\TEX/}}
2930 \def\copyxTeX{\\{copy\_\TEX/}}
3031
31−\def\title{CWEAVE (Version 3.6)}
32+\def\title{CWEAVE (Version 3.61)}
3233 \def\topofcontents{\null\vfill
3334 \centerline{\titlefont The {\ttitlefont CWEAVE} processor}
3435 \vskip 15pt
35− \centerline{(Version 3.6)}
36+ \centerline{(Version 3.61)}
3637 \vfill}
3738 \def\botofcontents{\vfill
3839 \noindent
39−Copyright \copyright\ 1987, 1990, 1993 Silvio Levy and Donald E. Knuth
40+Copyright \copyright\ 1987, 1990, 1993, 2000 Silvio Levy and Donald E. Knuth
4041 \bigskip\noindent
4142 Permission is granted to make and distribute verbatim copies of this
4243 document provided that the copyright notice and this permission notice
@@ -64,7 +65,7 @@ Crusius, and others who have contributed improvements. · 21 unmodified lines
6465 The ``banner line'' defined here should be changed whenever \.{CWEAVE}
6566 is modified.
6667
67−@d banner "This is CWEAVE (Version 3.6)\n"
68+@d banner "This is CWEAVE (Version 3.61)\n"
6869
6970 @c @<Include files@>@/
7071 @h
cweb.el+1−10
@@ -87,16 +87,7 @@ otherwise do an ordinary Meta-y." · 86 unmodified lines
8787 (let ((point-save (point)))
8888 (unwind-protect
8989 (progn (goto-char (mark))
90−; The next two lines of code are controversial ---
91−; they seem to be the best way to do a short wait and redraw the screen with
92−; standard emacs primitives --- but the short wait is a "busy wait".
93−; On a faster machine, it would be better to install the function
94−; sit-for-millisecs found in sunfns.c (if not already installed)
95−; and to say (sit-for-millisecs 100) instead.
96−; On a slower machine, do the call-process only once.
97−; On a still slower machine, (sit-for 1) is probably best.
98− (call-process "echo" nil nil t)
99− (call-process "echo" nil nil t))
90+ (sit-for 0 300)) ;; wait 300 milliseconds
10091 (goto-char point-save))))
10192
10293 ; I prefer to change the standard copy-region command to the following,
cwebmac.tex+44−25
@@ -1,12 +1,16 @@
11 % standard macros for CWEB listings (in addition to plain.tex)
2−% Version 3.6 --- May 2000
2+% Version 3.61 --- July 2000
33 \ifx\documentstyle\undefined\else\endinput\fi % LaTeX will use other macros
4−\xdef\fmtversion{\fmtversion+CWEB3.6}
4+\xdef\fmtversion{\fmtversion+CWEB3.61}
55 \newif\ifpdf
66 \ifx\pdf+\pdftrue\fi
77 % Uncomment the following line if you want PDF goodies to be the default
88 %\ifx\pdf-\else\pdftrue\fi
99 \def\pdflinkcolor{0 0 1} % the RGB values for hyperlink color
10+\newif\ifpdftex
11+\ifx\pdfoutput\undefined \pdftexfalse
12+\else \pdftextrue \pdfoutput=1 \pdfcompresslevel=9 \input pdfcolor \fi
13+\newif\ifacro \ifpdf\acrotrue\fi \ifpdftex\acrotrue\fi
1014
1115 \let\:=\. % preserve a way to get the dot accent
1216 % (all other accents will still work as usual)
@@ -115,18 +119,23 @@ · 102 unmodified lines
115119 \let\yskip=\smallskip
116120 \def\?{\mathrel?}
117121 \def\note#1#2.{\Y\noindent{\hangindent2em%
118− \baselineskip10pt\eightrm#1~\ifpdf{\pdfnote#2.}\else#2\fi.\par}}
122+ \baselineskip10pt\eightrm#1~\ifacro{\pdfnote#2.}\else#2\fi.\par}}
119123 % The following are pdf macros
120124 \newtoks\toksA \newtoks\toksB \newtoks\toksC
121125 \newtoks\toksD \newcount\countA \countA=0
122126 \def\thewidth{\the\wd0\space}
123127 \def\theheight{\the\ht0\space}
124128 \def\thedepth{\the\dp0\space}
125−\def\pdflink#1#2{\setbox0\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
126− \special{pdf: ec}}\special{pdf: ann width \thewidth\space height \theheight\space
127− depth \thedepth\space << /Type /Annot /Subtype /Link /Border [0 0 0] /A
128− << /S /GoTo /D (#2) >> >>}\box0\relax}
129+\ifpdftex\def\pdflink#1#2{\hbox{\pdfannotlink attr{/Border [0 0 0]} goto num #1
130+ \BlueGreen #1\Black\pdfendlink}}
131+\else\def\pdflink#1#2{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
132+ \special{pdf: ec}}\special{pdf: ann width \thewidth\space height \theheight
133+ \space depth \thedepth\space << /Type /Annot /Subtype /Link
134+ /Border [0 0 0] /A << /S /GoTo /D (#2) >> >>}\box0\relax}\fi
129135 \def\pdfnote#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}\maketoks}\the\toksA}
136+\def\firstsecno#1.{\setbox0=\hbox{\toksA={#1.}\toksB={}
137+ \def\makenote{\addtokens{\toksB}{\the\toksC}\def\makenote{\toksD={}
138+ \toksC={}\let\space\empty}\makenote}\maketoks}}
130139 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
131140 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
132141 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
@@ -154,9 +163,11 @@ · 21 unmodified lines
154163 \def\stsec{\rightskip=0pt % get out of C mode (cf. \B)
155164 \sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
156165 \noindent{\let\*=\lapstar\bf\secstar.\quad}%
157− \ifpdf{\raise\baselineskip\hbox to0pt{%
166+ \ifpdftex\smash{\raise\baselineskip\hbox to0pt{%
167+ \let\*=\empty\pdfdest num \secstar fith}}
168+ \else\ifpdf\smash{\raise\baselineskip\hbox to0pt{%
158169 \let\*=\empty\special{%
159− pdf: dest (\romannumeral\secstar) [ @thispage /FitH @ypos ]}}}\fi}
170+ pdf: dest (\romannumeral\secstar) [ @thispage /FitH @ypos ]}}}\fi\fi}
160171 \let\startsection=\stsec
161172 \def\defin#1{\global\advance\ind by 2 \1\&{#1 } } % begin `define' or `format'
162173 \def\A{\note{See also section}} % xref for doubly defined section name
@@ -191,7 +202,9 @@ · 28 unmodified lines
191202 \message{*\secno} % progress report
192203 \edef\next{\write\cont{\ZZ{#3}{#1}{\secno}% write to contents file
193204 {\noexpand\the\pageno}}}\next % \ZZ{title}{depth}{sec}{page}
194− \ifpdf\special{pdf: outline #1 << /Title (#3) /Dest [ @thispage /FitH @ypos ] >>}\fi
205+ \ifpdftex\pdfoutline goto num \secno {#3}
206+ \else\ifpdf\special{pdf: outline #1 << /Title (#3) /Dest
207+ [ @thispage /FitH @ypos ] >>}\fi\fi
195208 \ifon\startsection{\bf#3.\quad}\ignorespaces}
196209 \def\MN#1{\par % common code for \M, \N
197210 {\xdef\secstar{#1}\let\*=\empty\xdef\secno{#1}}% remove \* from section name
@@ -214,7 +227,8 @@ · 16 unmodified lines
214227 \let\V=\lor % logical or
215228 \let\W=\land % logical and
216229 \def\X#1:#2\X{\ifmmode\gdef\XX{\null$\null}\else\gdef\XX{}\fi %$% section name
217− \XX$\langle\,${\let\I=\ne#2\eightrm\kern.5em\ifpdf{\pdfnote#1.}\else#1\fi}$\,\rangle$\XX}
230+ \XX$\langle\,${\let\I=\ne#2\eightrm\kern.5em
231+ \ifacro{\pdfnote#1.}\else#1\fi}$\,\rangle$\XX}
218232 \def\Y{\par\yskip}
219233 \let\Z=\le
220234 \let\ZZ=\let % now you can \write the control sequence \ZZ
@@ -269,8 +283,9 @@ · 48 unmodified lines
269283 \mark{\noexpand\nullsec0{\the\gtitle}}
270284 \def\title{\expandafter\uppercase\expandafter{\jobname}}
271285 \def\topofcontents{\centerline{\titlefont\title}\vskip.7in
272− \ifpdf{\special{pdf: docview << /PageMode /UseOutlines >>}}\fi
273286 \vfill} % this material will start the table of contents page
287+\def\startpdf{\ifpdftex\pdfcatalog{/PageMode /UseOutlines}\else
288+ \ifpdf{\special{pdf: docview << /PageMode /UseOutlines >>}}\fi\fi}
274289 \def\botofcontents{\vfill
275290 \centerline{\covernote}} % this material will end the table of contents page
276291 \def\covernote{}
@@ -320,7 +335,7 @@ · 43 unmodified lines
320335 \message{Index:}
321336 \parskip 0pt plus .5pt
322337 \outer\def\I##1, ##2.{\par\hangindent2em\noindent##1:\kern1em
323− \ifpdf\pdfnote##2.\else##2\fi.} % index entry
338+ \ifacro\pdfnote##2.\else##2\fi.} % index entry
324339 \def\[##1]{$\underline{##1}$} % underlined index item
325340 \rm \rightskip0pt plus 2.5em \tolerance 10000 \let\*=\lapstar
326341 \hyphenpenalty 10000 \parindent0pt
@@ -330,19 +345,27 @@ · 3 unmodified lines
330345 \if L\lr\else\null\vfill\eject\fi % finish the current page
331346 \parfillskip 0pt plus 1fil
332347 \def\grouptitle{NAMES OF THE SECTIONS}
333− \ifpdf
348+ \ifpdftex
349+ \def\outsecname{Names of the sections}
350+ \pdfdest name {NOS} fitb
351+ \pdfoutline goto name {NOS} count -\secno {\outsecname}
352+ \let\Xpdf\X
353+ \def\X##1:##2\X{\Xpdf##1:##2\X
354+ \firstsecno##1.\toks0{##2}\pdfoutline goto num \the\toksA {\the\toks0}}
355+ \else\ifpdf
334356 \def\outsecname{Names of the sections}
335357 \special{pdf: outline -1 << /Title (\outsecname)
336358 /Dest [ @thispage /FitH @ypos ] >>}
337359 \let\Xpdf\X
338− \def\X##1:##2\X{\Xpdf##1:##2\X \toks0{##2} \special{pdf: outline 0
339− << /Title (\the\toks0) /A << /S /GoTo /D (\romannumeral##1) >> >>}}
340− \fi
360+ \def\X##1:##2\X{\Xpdf##1:##2\X
361+ \firstsecno##1.\toks0{##2} \special{pdf: outline 0 << /Title
362+ (\the\toks0) /A << /S /GoTo /D (\romannumeral\the\toksA) >> >>}}
363+ \fi\fi
341364 \let\topsecno=\nullsec
342365 \message{Section names:}
343366 \output={\normaloutput\page\lheader\rheader}
344367 \setpage
345− \def\note##1##2.{\quad{\eightrm##1~\ifpdf{\pdfnote##2.}\else{##2}\fi.}}
368+ \def\note##1##2.{\quad{\eightrm##1~\ifacro{\pdfnote##2.}\else{##2}\fi.}}
346369 \def\Q{\note{Cited in section}} % crossref for mention of a section
347370 \def\Qs{\note{Cited in sections}} % crossref for mentions of a section
348371 \def\U{\note{Used in section}} % crossref for use of a section
@@ -357,7 +380,7 @@ · 8 unmodified lines
357380 \pageno=\contentspagenumber
358381 \def\grouptitle{TABLE OF CONTENTS}
359382 \message{Table of contents:}
360− \topofcontents
383+ \topofcontents \startpdf
361384 \line{\hfil Section\hbox to3em{\hss Page}}
362385 \let\ZZ=\contentsline
363386 \readcontents\relax % read the contents info
@@ -365,14 +388,11 @@ · 1 unmodified line
365388 \def\contentsline#1#2#3#4{\ifnum#2=0 \smallbreak\fi
366389 \line{\consetup{#2}#1
367390 \rm\leaders\hbox to .5em{.\hfil}\hfil
368− \ \ifpdf\pdflink{#3}{\romannumeral#3}\else#3\fi\hbox to3em{\hss#4}}}
391+ \ \ifacro\pdflink{#3}{\romannumeral#3}\else#3\fi\hbox to3em{\hss#4}}}
369392 \def\consetup#1{\ifcase#1 \bf % depth -1 (@**)
370393 \or % depth 0 (@*)
371394 \or \hskip2em % depth 1 (@*1)
372− \or \hskip4em % depth 2 (@*2)
373− \or \hskip6em % depth 3 (@*3)
374− \or \hskip8em % depth 4 (@*4)
375− \or \hskip10em % depth 5 (@*5)
395+ \or \hskip4em \or \hskip6em \or \hskip8em \or \hskip10em % depth 2,3,4,5
376396 \else \hskip12em \fi} % depth 6 or more
377397 \def\noinx{\let\inx=\end} % no indexes or table of contents
378398 \def\nosecs{\let\FIN=\fin \def\fin{\let\parfillskip=\end \FIN}}
@@ -398,4 +418,3 @@ · 19 unmodified lines
398418 \def\datecontentspage{%
399419 \def\topofcontents{\leftline{\sc\today\ at \hours}\bigskip
400420 \centerline{\titlefont\title}\vfill}} % timestamps the contents page
401−
cwebman.tex+7−4
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434
3535 \def\lheader{\mainfont\the\pageno\hfill\sc\runninghead\hfill}
3636 \def\rheader{\hfill\sc\runninghead\hfill\mainfont\the\pageno}
37−\def\runninghead{{\tentt CWEB} USER MANUAL (VERSION 3.6)}
37+\def\runninghead{{\tentt CWEB} USER MANUAL (VERSION 3.61)}
3838
3939 % This verbatim mode assumes that ! marks are !! in the text being copied.
4040 \def\verbatim{\begingroup
@@ -48,7 +48,7 @@ · 7 unmodified lines
4848 \null\vfill
4949 \centerline{\titlefont The {\ttitlefont CWEB} System of
5050 Structured Documentation}
51−\vskip 18pt\centerline{(Version 3.6 --- May 2000)}
51+\vskip 18pt\centerline{(Version 3.61 --- July 2000)}
5252 \vskip 24pt
5353 \centerline{\authorfont Donald E. Knuth and Silvio Levy}
5454 \vfill
@@ -60,7 +60,7 @@ · 5 unmodified lines
6060 The printed form of this manual is copyright \copyright\ 1994
6161 by Addison-Wesley Publishing Company, Inc. All rights reserved.
6262 \smallskip\noindent
63−The electronic form is copyright \copyright\ 1987, 1990, 1993
63+The electronic form is copyright \copyright\ 1987, 1990, 1993, 2000
6464 by Silvio Levy and Donald E. Knuth.
6565
6666 \bigskip\noindent
@@ -1139,6 +1139,9 @@ dvipdfm cob\cr · 1072 unmodified lines
11391139 acroread cob.pdf\cr}}$$
11401140 instead of invoking \TeX\ in the normal way. (Thanks to Hans Hagen and
11411141 C\'esar Augusto Rorato Crusius for the macros that make this work.)
1142+Alternatively, thanks to H\`an Th\^e\kern-.3em\raise.3ex\hbox{\'{}} Th\`anh
1143+and Andreas Scherer, you can generate \.{cob.pdf} in one step by simply
1144+saying `\.{pdftex}~\.{cob}'.
11421145
11431146 A more elaborate system called \.{CTWILL}, which extends the usual cross
11441147 references of \.{CWEAVE} by preparing links from the uses of identifiers
@@ -1565,7 +1568,7 @@ $$\lpile{\.{\\def\\topofcontents\{\\null\\vfill}\cr · 420 unmodified lines
15651568 \.{ { }\\titlefalse \% include headline on the contents page}\cr
15661569 \.{ { }\\def\\rheader\{\\mainfont The \{\\tt CWEAVE\}{ }processor\\hfil\}}\cr
15671570 \.{ { }\\centerline\{\\titlefont The \{\\ttitlefont CWEAVE\}{ }processor\}}\cr
1568− \.{ { }\\vskip 15pt \\centerline\{(Version 3.6)\}{ }\\vfill\}}\cr}$$
1571+ \.{ { }\\vskip 15pt \\centerline\{(Version 3.61)\}{ }\\vfill\}}\cr}$$
15691572 Redefining \.{\\rheader}, which is the headline for right-hand pages,
15701573 suffices in this case to put the desired information at the top of the
15711574 contents page.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t