*** webman.tex.org	1990-09-06 00:53:28.000000000 +0200
--- webman.tex	2014-02-03 21:10:39.734399312 +0100
***************
*** 13,25 ****
  \def\pb{\.{|...|}}
  \def\lpile{\def\cr{\hfill\endline}\matrix} % I only use \lpile by itself
  
! \outer\def\section #1.{\penalty-50\vskip 12pt plus 3pt minus 3pt
!   \noindent{\bf #1.}\quad\ignorespaces}
  
  \def\lheader{\mainfont\the\pageno\hfill\sc\runninghead\hfill}
  \def\rheader{\hfill\sc\runninghead\hfill\mainfont\the\pageno}
  \def\runninghead{{\tentt WEB} USER MANUAL}
  
  % This verbatim mode assumes that no ? appears in the text being copied.
  \def\verbatim{\begingroup
    \def\do##1{\catcode`##1=12 } \dospecials
--- 13,76 ----
  \def\pb{\.{|...|}}
  \def\lpile{\def\cr{\hfill\endline}\matrix} % I only use \lpile by itself
  
! \newcount\destcount
! \destcount=1\relax
! 
! \def\bkminfo{}
! \outer\def\section #1.{%
!   \penalty-50\vskip 12pt plus 3pt minus 3pt
!   \noindent
!   \vbox to 0pt{%
!     \kern-2.5ex\relax
!     \pdfdest num\destcount fitbh\relax
!     \def\.##1{##1}%
!     \ifx\bkminfo\empty
!       \pdfoutline goto num\destcount{#1}\relax
!     \else
!       \pdfoutline goto num\destcount{#1 (\bkminfo)}\relax
!     \fi
!     \gdef\bkminfo{}%
!     \global\advance\destcount by 1\relax
!     \kern2.5ex\relax
!   }%
!   {\bf #1.}\quad\ignorespaces
! }
  
  \def\lheader{\mainfont\the\pageno\hfill\sc\runninghead\hfill}
  \def\rheader{\hfill\sc\runninghead\hfill\mainfont\the\pageno}
  \def\runninghead{{\tentt WEB} USER MANUAL}
  
+ \pdfinfo{%
+   /Author(Donald E. Knuth)%
+   /Title(WEB User Manual)%
+ }
+ 
+ \def\LinkColor{%
+   \pdfliteral{1 0 0 rg}%
+ }
+ \def\Black{%
+   \pdfliteral{0 g}%
+ }
+ \def\appA{7}
+ \def\appB{8}
+ \def\appC{9}
+ \def\appD{0}
+ \def\appE{0}
+ \def\appF{10}
+ \def\appG{11}
+ \def\appH{12}
+ 
+ \def\appref#1{%
+   \leavevmode
+   \ifnum\csname app#1\endcsname>0 %
+     \pdfstartlink attr{/Border[0 0 0]} goto num\csname app#1\endcsname\relax
+     \LinkColor\hbox{Appendix}~#1\Black
+     \pdfendlink
+   \else
+     Appendix~#1%
+   \fi
+ }
+ 
  % This verbatim mode assumes that no ? appears in the text being copied.
  \def\verbatim{\begingroup
    \def\do##1{\catcode`##1=12 } \dospecials
***************
*** 624,630 ****
  `\.{@\{}' is converted into `\.[', since \PASCAL\ does not allow
  nested comments. Incidentally, module numbers are automatically inserted
  as meta-comments into the \PASCAL\ program, in order to help correlate the
! outputs of \.{WEAVE} and \.{TANGLE} (see Appendix~C\null). Meta-comments
  can be used to put conditional text into a \PASCAL\ program; this helps to
  overcome one of the limitations of \.{WEB}, since the simple macro
  processing routines of \.{TANGLE} do not include the dynamic evaluation of
--- 675,681 ----
  `\.{@\{}' is converted into `\.[', since \PASCAL\ does not allow
  nested comments. Incidentally, module numbers are automatically inserted
  as meta-comments into the \PASCAL\ program, in order to help correlate the
! outputs of \.{WEAVE} and \.{TANGLE} (see \appref C\null). Meta-comments
  can be used to put conditional text into a \PASCAL\ program; this helps to
  overcome one of the limitations of \.{WEB}, since the simple macro
  processing routines of \.{TANGLE} do not include the dynamic evaluation of
***************
*** 757,763 ****
  characters as output if the input consists entirely of ASCII characters.
  
  2. If you have an extended character set, all of the characters listed
! in Appendix C of {\sl The \TeX book\/} can be used in strings. But you should
  stick to standard ASCII characters if you want to write programs that will
  be useful to all the poor souls out there who don't have extended
  character sets.
--- 808,814 ----
  characters as output if the input consists entirely of ASCII characters.
  
  2. If you have an extended character set, all of the characters listed
! in \appref C of {\sl The \TeX book\/} can be used in strings. But you should
  stick to standard ASCII characters if you want to write programs that will
  be useful to all the poor souls out there who don't have extended
  character sets.
***************
*** 890,912 ****
  to time.
  \section Appendices.
  The basic ideas of \.{WEB} can be understood most easily by looking at
! examples of ``real'' programs. Appendix~A shows the \.{WEB} input that
! generated modules 55--59 of the \.{WEAVE} program; Appendix~B shows the
! corresponding \TeX\ code output by \.{WEAVE}; and Appendix~C shows excerpts
  from the corresponding \PASCAL\ code output by \.{TANGLE}.
  
  The complete webs for \.{WEAVE} and \.{TANGLE} appear as the bulk of this
! report, in Appendices D and~E. The reader should first compare Appendix~A
! to the corresponding portion of Appendix~D; then the same material should
  be compared to Appendices B and~C. Finally, if time permits, the reader may
  enjoy studying the complete programs in Appendices D and~E, since \.{WEAVE}
  and \.{TANGLE} contain several interesting aspects, and since an attempt
  has been made in these appendices to evolve a style of programming that
  makes good use of the \.{WEB} language.
  
! Finally, Appendix F is the `\.{webmac}' file that sets \TeX\ up to accept
! the output of \.{WEAVE}; Appendix~G discusses how to use some of its macros
! to vary the output formats; and Appendix~H discusses what needs to be done
  when \.{WEAVE} and \.{TANGLE} are installed in a new operating environment.
  \section Performance statistics.
  The programs in Appendices D and E will optionally keep statistics on
--- 941,963 ----
  to time.
  \section Appendices.
  The basic ideas of \.{WEB} can be understood most easily by looking at
! examples of ``real'' programs. \appref A shows the \.{WEB} input that
! generated modules 55--59 of the \.{WEAVE} program; \appref B shows the
! corresponding \TeX\ code output by \.{WEAVE}; and \appref C shows excerpts
  from the corresponding \PASCAL\ code output by \.{TANGLE}.
  
  The complete webs for \.{WEAVE} and \.{TANGLE} appear as the bulk of this
! report, in Appendices D and~E. The reader should first compare \appref A
! to the corresponding portion of \appref D; then the same material should
  be compared to Appendices B and~C. Finally, if time permits, the reader may
  enjoy studying the complete programs in Appendices D and~E, since \.{WEAVE}
  and \.{TANGLE} contain several interesting aspects, and since an attempt
  has been made in these appendices to evolve a style of programming that
  makes good use of the \.{WEB} language.
  
! Finally, \appref F is the `\.{webmac}' file that sets \TeX\ up to accept
! the output of \.{WEAVE}; \appref G discusses how to use some of its macros
! to vary the output formats; and \appref H discusses what needs to be done
  when \.{WEAVE} and \.{TANGLE} are installed in a new operating environment.
  \section Performance statistics.
  The programs in Appendices D and E will optionally keep statistics on
***************
*** 985,992 ****
  }}
  \eject
  \def\runninghead{APPENDIX A --- {\tentt WEB} FILE FORMAT}
  \section Appendix A.
! This excerpt from \.{WEAVE.WEB} produced modules 55--59 in Appendix~D.
  Note that some of the lines are indented to show the program structure.
  The indentation is ignored by \.{WEAVE} and \.{TANGLE}, but users find
  that \.{WEB} files are quite readable if they have some such indentation.
--- 1036,1044 ----
  }}
  \eject
  \def\runninghead{APPENDIX A --- {\tentt WEB} FILE FORMAT}
+ \def\bkminfo{WEB file format}
  \section Appendix A.
! This excerpt from \.{WEAVE.WEB} produced modules 55--59 in \appref D.
  Note that some of the lines are indented to show the program structure.
  The indentation is ignored by \.{WEAVE} and \.{TANGLE}, but users find
  that \.{WEB} files are quite readable if they have some such indentation.
***************
*** 1057,1064 ****
  \endgroup
  \vfill\eject
  \def\runninghead{APPENDIX B --- TRANSLATION BY {\tentt WEAVE}}
  \section Appendix B.
! This excerpt from \.{WEAVE.TEX} corresponds to Appendix A.
  
  % I've inserted \vfill's here at the blank lines, to squeeze this on one page!
  \begingroup \def\tt{\eighttt} \baselineskip9pt
--- 1109,1117 ----
  \endgroup
  \vfill\eject
  \def\runninghead{APPENDIX B --- TRANSLATION BY {\tentt WEAVE}}
+ \def\bkminfo{Translation by weave}
  \section Appendix B.
! This excerpt from \.{WEAVE.TEX} corresponds to \appref A.
  
  % I've inserted \vfill's here at the blank lines, to squeeze this on one page!
  \begingroup \def\tt{\eighttt} \baselineskip9pt
***************
*** 1139,1144 ****
--- 1192,1198 ----
  \endgroup
  \eject
  \def\runninghead{APPENDIX C --- TRANSLATION BY {\tentt TANGLE}}
+ \def\bkminfo{Translation by tangle}
  \section Appendix C.
  The \.{TANGLE} processor converts \.{WEAVE.WEB} into a syntactically
  correct (but not very pretty) \PASCAL\ program \.{WEAVE.PAS}.
***************
*** 1458,1470 ****
  opposite sides of each sheet.
  
  \point 6. The \.{\\title} macro will appear at the top of each page
! in small caps. For example, Appendix~D was produced after saying
  `\.{\\def\\title\{WEAVE\}}'.
  
  \point 7. The first page usually is assigned page number 1.
  To start on page 16, with contents
  on page 15, say this: `\.{\\def\\contentspagenumber\{15\}}
! \.{\\pageno=\\contentspagenumber} \.{\\advance\\pageno by 1}'. (Appendix~D
  was generated that way.)
  
  \point 8. The macro \.{\\iftitle} will suppress the header line if it is
--- 1512,1524 ----
  opposite sides of each sheet.
  
  \point 6. The \.{\\title} macro will appear at the top of each page
! in small caps. For example, \appref D was produced after saying
  `\.{\\def\\title\{WEAVE\}}'.
  
  \point 7. The first page usually is assigned page number 1.
  To start on page 16, with contents
  on page 15, say this: `\.{\\def\\contentspagenumber\{15\}}
! \.{\\pageno=\\contentspagenumber} \.{\\advance\\pageno by 1}'. (\appref D
  was generated that way.)
  
  \point 8. The macro \.{\\iftitle} will suppress the header line if it is
***************
*** 1475,1484 ****
  Two macros are provided to give flexibility to the table of
  contents: \.{\\topofcontents} is invoked just before the contents
  info is read, and \.{\\botofcontents} is invoked just after.
! For example, Appendix~D was produced with the following definitions:
  $$\lpile{\.{\\def\\topofcontents\{\\null\\vfill}\cr
    \.{ { }\\titlefalse \% include headline on the contents page}\cr
!   \.{ { }\\def\\rheader\{\\mainfont Appendix D\\hfil 15\}}\cr
    \.{ { }\\centerline\{\\titlefont The \{\\ttitlefont WEAVE\}{ }processor\}}\cr
    \.{ { }\\vskip 15pt \\centerline\{(Version 4)\}{ }\\vfill\}}\cr}$$
  Redefining \.{\\rheader}, which is the headline for right-hand pages,
--- 1529,1538 ----
  Two macros are provided to give flexibility to the table of
  contents: \.{\\topofcontents} is invoked just before the contents
  info is read, and \.{\\botofcontents} is invoked just after.
! For example, \appref D was produced with the following definitions:
  $$\lpile{\.{\\def\\topofcontents\{\\null\\vfill}\cr
    \.{ { }\\titlefalse \% include headline on the contents page}\cr
!   \.{ { }\\def\\rheader\{\\mainfont \appref D\\hfil 15\}}\cr
    \.{ { }\\centerline\{\\titlefont The \{\\ttitlefont WEAVE\}{ }processor\}}\cr
    \.{ { }\\vskip 15pt \\centerline\{(Version 4)\}{ }\\vfill\}}\cr}$$
  Redefining \.{\\rheader}, which is the headline for right-hand pages,
***************
*** 1487,1493 ****
  
  \point 9. Data for the table of contents is written to a file that
  is read after the indexes have been \TeX ed; there's one line of data
! for every starred module. For example, when Appendix~D was being generated,
  a file \.{CONTENTS.TEX} containing
  $$\lpile{\.{\\Z \{{ }Introduction\}\{1\}\{16\}}\cr
    \.{\\Z \{{ }The character set\}\{11\}\{19\}}\cr}$$
--- 1541,1547 ----
  
  \point 9. Data for the table of contents is written to a file that
  is read after the indexes have been \TeX ed; there's one line of data
! for every starred module. For example, when \appref D was being generated,
  a file \.{CONTENTS.TEX} containing
  $$\lpile{\.{\\Z \{{ }Introduction\}\{1\}\{16\}}\cr
    \.{\\Z \{{ }The character set\}\{11\}\{19\}}\cr}$$
***************
*** 1579,1585 ****
  \.{TANGLE.PAS}, and \.{WEBMAC.TEX}. The tape will probably also contain an
  example change file \.{TANGLE.CH}.
  \step(2) Look at the sections of \.{TANGLE} that are listed under ``system
! dependencies'' in the index of Appendix~E above, and figure out what changes
  (if any) will be needed for your system.
  \step(3) Make a change file \.{TANGLE.CH} that contains the changes of~(2);
  do not change your copy of \.{TANGLE.WEB}, leave it intact. (The
--- 1633,1639 ----
  \.{TANGLE.PAS}, and \.{WEBMAC.TEX}. The tape will probably also contain an
  example change file \.{TANGLE.CH}.
  \step(2) Look at the sections of \.{TANGLE} that are listed under ``system
! dependencies'' in the index of \appref E above, and figure out what changes
  (if any) will be needed for your system.
  \step(3) Make a change file \.{TANGLE.CH} that contains the changes of~(2);
  do not change your copy of \.{TANGLE.WEB}, leave it intact. (The
***************
*** 1605,1622 ****
  working \.{TANGLE} program.
  \step(7) Make a change file \.{WEAVE.CH} analogous to (3), but this time
  consider the system-dependent parts of \.{WEAVE} that are listed in
! the index to Appendix~D.
  \step(8) Run \.{TANGLE} on \.{WEAVE.WEB} and your \.{WEAVE.CH}, obtaining
  \.{WEAVE.PAS}.
  \step(9) Use \PASCAL\ on \.{WEAVE.PAS} to make a running \.{WEAVE} program.
  \step(10) Run \.{WEAVE} on \.{TANGLE.WEB} and \.{TANGLE.CH} to produce
  \.{TANGLE.TEX}.
  \step(11) Run \TeX\ on \.{TANGLE.TEX}, obtaining a listing analogous to
! Appendix~E. This listing will incorporate your changes.
  \step(12) Run \.{WEAVE} on \.{WEAVE.WEB} and your \.{WEAVE.CH} to produce
  \.{WEAVE.TEX}.
  \step(13) Run \TeX\ on \.{WEAVE.TEX}, obtaining a listing analogous to
! Appendix~D that incorporates your changes.
  
  \yskip\noindent
  This description assumes that you already have a working \TeX82 system.
--- 1659,1676 ----
  working \.{TANGLE} program.
  \step(7) Make a change file \.{WEAVE.CH} analogous to (3), but this time
  consider the system-dependent parts of \.{WEAVE} that are listed in
! the index to \appref D.
  \step(8) Run \.{TANGLE} on \.{WEAVE.WEB} and your \.{WEAVE.CH}, obtaining
  \.{WEAVE.PAS}.
  \step(9) Use \PASCAL\ on \.{WEAVE.PAS} to make a running \.{WEAVE} program.
  \step(10) Run \.{WEAVE} on \.{TANGLE.WEB} and \.{TANGLE.CH} to produce
  \.{TANGLE.TEX}.
  \step(11) Run \TeX\ on \.{TANGLE.TEX}, obtaining a listing analogous to
! \appref E. This listing will incorporate your changes.
  \step(12) Run \.{WEAVE} on \.{WEAVE.WEB} and your \.{WEAVE.CH} to produce
  \.{WEAVE.TEX}.
  \step(13) Run \TeX\ on \.{WEAVE.TEX}, obtaining a listing analogous to
! \appref D that incorporates your changes.
  
  \yskip\noindent
  This description assumes that you already have a working \TeX82 system.
***************
*** 1669,1672 ****
  the whole project is not impossibly difficult, because in fact the entire
  development of \.{WEAVE} and \.{TANGLE} (including the writing of the
  programs and this manual) took less than two months of work.
! \vfill\end
--- 1723,1728 ----
  the whole project is not impossibly difficult, because in fact the entire
  development of \.{WEAVE} and \.{TANGLE} (including the writing of the
  programs and this manual) took less than two months of work.
! \vfill
! \input knuth-outline.tex
! \end
