| 1 |
@q Changes for CWEB in TeX Live from numerous contributors. @> |
| 2 |
@q This file is in the Public Domain. @> |
| 3 |
|
| 4 |
@q Most of the original Kpathsea changes by Wlodek Bzyl and Olaf Weber @> |
| 5 |
@q were merged with the set of change files of the CWEBbin project; @> |
| 6 |
@q see https://github.com/ascherer/cwebbin for the original parts. @> |
| 7 |
|
| 8 |
@q This stripped change file {comm,ctang,cweav,ctwill,cwebman}-w2c.ch @> |
| 9 |
@q has been created from the elaborate set of change files @> |
| 10 |
@q {comm,ctang,cweav,cwebman}-patch.ch, @> |
| 11 |
@q {comm,cweav,cwebman}-extensions.ch, {comm,ctang,cweav}-output.ch, @> |
| 12 |
@q {comm,ctang,cweav}-i18n.ch, and cweav-twill.ch for CTWILL, and @> |
| 13 |
@q {comm,ctang,cweav,ctwill,cwebman}-texlive.ch with the 'tie' processor @> |
| 14 |
@q and is used as a monolithic changefile for {common,ctangle,cweave}.w @> |
| 15 |
@q and cwebman.tex in TeX Live. @> |
| 16 |
|
| 17 |
@q Please send comments, suggestions, etc. to tex-k@@tug.org. @> |
| 18 |
|
| 19 |
@x l.4 |
| 20 |
\input cwebmac |
| 21 |
\pdffalse\acrohintfalse |
| 22 |
@y |
| 23 |
\input cwebmac |
| 24 |
\ifhint \input hiplainpage \fi |
| 25 |
@z |
| 26 |
|
| 27 |
@x l.6 |
| 28 |
\def\page{\box255 } \normalbottom |
| 29 |
@y |
| 30 |
\let\page=\pagebody \raggedbottom |
| 31 |
\newcount\footnotecount \footnotecount 1\relax |
| 32 |
\def\cwebfootnote#1{\footnote{${}^{\the\footnotecount}$}{#1}% |
| 33 |
\advance\footnotecount by 1\relax} |
| 34 |
@z |
| 35 |
|
| 36 |
@x l.28 |
| 37 |
\outer\def\section #1.{\penalty-500\bigskip |
| 38 |
\centerline{\sectionfont\def\.##1{{\twelvett##1}} #1}\nobreak\vskip 6pt |
| 39 |
\everypar{\hskip-\parindent\everypar{}}} |
| 40 |
@y |
| 41 |
\ifacro |
| 42 |
\pdfpagewidth=\pagewidth \advance\pdfpagewidth by 2cm |
| 43 |
\pdfpageheight=\pageheight \advance\pdfpageheight by 3cm |
| 44 |
\ifpdflua \pdfhorigin=1cm \pdfvorigin=1cm |
| 45 |
\else \advance\pdfpageheight by 1cm \global\pageshift=-1.54cm |
| 46 |
\global\hoffset=-1.54cm \global\voffset=-1.54cm \fi |
| 47 |
\fi |
| 48 |
|
| 49 |
\newcount\destcount \destcount=1\relax |
| 50 |
|
| 51 |
\def\subsections{0} |
| 52 |
\outer\def\section #1.{\penalty-500\bigskip |
| 53 |
\centerline{\sectionfont\def\.##1{{\twelvett##1}} |
| 54 |
\ifacro\vbox to 0pt{\kern-2.5ex\relax |
| 55 |
\ifpdflua\pdfdest num \destcount fith\relax |
| 56 |
\else\special{pdf: dest (\the\destcount) [ @thispage /FitH @ypos ]}\fi |
| 57 |
\def\.##1{##1}\def\TeX{TeX}% |
| 58 |
\ifpdflua\pdfoutline goto num \destcount |
| 59 |
\ifnum\subsections>0 count -\subsections\fi {#1}\relax |
| 60 |
\else\special{pdf: outline 0 << /Title (#1) |
| 61 |
/A << /S /GoTo /D (\the\destcount) >> >>}\fi |
| 62 |
\gdef\subsections{0}% |
| 63 |
\global\advance\destcount by 1\relax |
| 64 |
\kern2.5ex\relax |
| 65 |
}\fi #1}\nobreak\vskip 6pt |
| 66 |
\everypar{\hskip-\parindent\everypar{}}} |
| 67 |
|
| 68 |
\def\appA{15} |
| 69 |
\def\appB{16} |
| 70 |
\def\appC{17} |
| 71 |
|
| 72 |
\def\Appendix#1{\leavevmode |
| 73 |
\ifacro\ifpdflua |
| 74 |
\pdfstartlink attr{/Border[0 0 0]} goto num\csname app#1\endcsname\relax |
| 75 |
\Blue\hbox{Appendix}~#1\Black |
| 76 |
\pdfendlink |
| 77 |
\else |
| 78 |
\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{\hbox{Appendix}~#1}% |
| 79 |
\special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight |
| 80 |
depth \thedepth << /Type /Annot /Subtype /Link /Border [0 0 0] |
| 81 |
/A << /S /GoTo /D (\csname app#1\endcsname) >> >>}\box0\relax |
| 82 |
\fi\else Appendix~#1\fi} |
| 83 |
|
| 84 |
\newcount\subdestcount \subdestcount=151\relax |
| 85 |
|
| 86 |
\outer\def\subsection #1.{\ifacro |
| 87 |
\ifpdflua\pdfdest num \subdestcount fith\relax |
| 88 |
\pdfoutline goto num \subdestcount {#1}\relax |
| 89 |
\else\special{pdf: dest (\the\subdestcount) [ @thispage /FitH @ypos ]}% |
| 90 |
\special{pdf: outline 1 << /Title (#1) |
| 91 |
/A << /S /GoTo /D (\the\subdestcount) >> >>}\fi |
| 92 |
\global\advance\subdestcount by 1\relax |
| 93 |
\fi} |
| 94 |
@z |
| 95 |
|
| 96 |
@x l.34 |
| 97 |
\def\runninghead{{\ninett CWEB} USER MANUAL (VERSION 4.12.2)} |
| 98 |
@y |
| 99 |
\def\Kpathsea/{{\mc KPATHSEA\spacefactor1000}} |
| 100 |
\def\runninghead{{\ninett CWEB} USER MANUAL (Version 4.12.2 [\TeX~Live])} |
| 101 |
@z |
| 102 |
|
| 103 |
@x l.48 |
| 104 |
\vskip 18pt\centerline{(Version 4.12.2 --- July 2025)} |
| 105 |
@y |
| 106 |
\vskip 18pt\centerline{(Version 4.12.2 --- July 2025)% |
| 107 |
\footnote*{This document describes the extended \.{CWEB} (Version 4.12.2 [\TeX~Live]).}} |
| 108 |
@z |
| 109 |
|
| 110 |
@x l.79 |
| 111 |
Internet page \.{http://www-cs-faculty.stanford.edu/\char`\~knuth/cweb.html} |
| 112 |
@y |
| 113 |
Internet page |
| 114 |
\pdfURL{\.{http://www-cs-faculty.stanford.edu/\char`\~knuth/cweb.html}}% |
| 115 |
{http://www-cs-faculty.stanford.edu/\TILDE/knuth/cweb.html} |
| 116 |
@z |
| 117 |
|
| 118 |
@x l.84 |
| 119 |
\.{https://github.com/ascherer/cweb} with the really current news. |
| 120 |
@y |
| 121 |
\pdfURL{\.{https://github.com/ascherer/cweb}}% |
| 122 |
{https://github.com/ascherer/cweb} |
| 123 |
with the really current news. |
| 124 |
@z |
| 125 |
|
| 126 |
@x l.102 |
| 127 |
should be sent to the \TeX-related mailing list \.{[email protected]}. |
| 128 |
@y |
| 129 |
should be sent to the \TeX-related mailing list |
| 130 |
\pdfURL{\.{[email protected]}}% |
| 131 |
{mailto:[email protected]}. |
| 132 |
@z |
| 133 |
|
| 134 |
@x l.104 |
| 135 |
Readers who are familiar with Knuth's memo ``The \.{WEB} System of Structured |
| 136 |
Documentation'' will be able |
| 137 |
@y |
| 138 |
Readers who are familiar with Knuth's memo ``\pdfURL{The \.{WEB} System of |
| 139 |
Structured Documentation}{../web/webman-changes.pdf}'' will be able |
| 140 |
@z |
| 141 |
|
| 142 |
@x l.523 |
| 143 |
email address in a \.{CWEB} file (e.g., \.{tex-k@@tug.org}). |
| 144 |
@y |
| 145 |
email address in a \.{CWEB} file (e.g., |
| 146 |
\pdfURL{\.{tex-k@@tug.org}}% |
| 147 |
{mailto:[email protected]}). |
| 148 |
@z |
| 149 |
|
| 150 |
@x l.918 |
| 151 |
it cannot find them in the current directory. |
| 152 |
@y |
| 153 |
it cannot find them in the current directory.% |
| 154 |
\cwebfootnote{In this extended implementation, if an \.{@i}nclude file can not |
| 155 |
be found in the current directory, \.{CWEB} will use the conventions of the |
| 156 |
\Kpathsea/ library as outlined in {\pdffalse\acrohintfalse section~\X93:File |
| 157 |
lookup with \Kpathsea/\X~of} \pdfURL{appendix~D}{common-changes.pdf} to look |
| 158 |
for it. |
| 159 |
% FIXME |
| 160 |
(This is true for any other input or change file lookup.)} |
| 161 |
@z |
| 162 |
|
| 163 |
@x l.1025 |
| 164 |
except for error messages. |
| 165 |
@y |
| 166 |
except for error messages.% |
| 167 |
\cwebfootnote{\.{CWEB} in \TeX~Live runs `\.{--quiet}ly', i.\,e., |
| 168 |
options `\.{b}', `\.{h}', and `\.{p}' are `off' by default.} |
| 169 |
@z |
| 170 |
|
| 171 |
@x l.1031 |
| 172 |
options are currently implemented: |
| 173 |
|
| 174 |
\yskip |
| 175 |
\def\option#1 {\textindent{\.#1}\hangindent2\parindent} |
| 176 |
@y |
| 177 |
\def\option#1 {\textindent{\.#1}\hangindent2\parindent}% |
| 178 |
options are currently implemented:% |
| 179 |
\cwebfootnote{This extended version of \.{CWEB} adds the following options |
| 180 |
to the list: |
| 181 |
\hfil\smallskip |
| 182 |
\option c Check temporary output files for changes. (Off by default.) |
| 183 |
\hfil\vskip\normallineskip |
| 184 |
\option d Set the debugging variable \\{kpathsea\_debug} to the numeric |
| 185 |
value $N\in[0,127]$ of this option. See section~95 % FIXME |
| 186 |
of \pdfURL{appendix~D}{common-changes.pdf} for details. |
| 187 |
\hfil\vskip\normallineskip |
| 188 |
\option i Indent parameters in function declarations. (On by default; |
| 189 |
\.{-i} typesets declarations flush left; some people think this to be |
| 190 |
more logical than indenting them.) (Has no effect on \.{CTANGLE}.) |
| 191 |
\hfil\vskip\normallineskip |
| 192 |
\option l This option takes the string of characters to its right as its |
| 193 |
argument to switch between different user languages and macro packages. |
| 194 |
(Off by default.) (Has no effect on \.{CTANGLE}.) |
| 195 |
\hfil\vskip\normallineskip |
| 196 |
\option o Separate declarations and the first statement in a function block. |
| 197 |
(On by default.) (\.{CWEAVE} only.) |
| 198 |
\hfil\vskip\normallineskip |
| 199 |
\option u Transliteration of UTF-8 multi-byte characters. |
| 200 |
(Off by default.) (Has no effect on \.{CWEAVE}.)} |
| 201 |
|
| 202 |
\yskip |
| 203 |
@z |
| 204 |
|
| 205 |
@x l.1067 |
| 206 |
\option x Include indexes and a table of contents in the \TEX/ file |
| 207 |
output by \.{CWEAVE}. (On by default.) (Has no effect on \.{CTANGLE}.) |
| 208 |
@y |
| 209 |
\option x Include indexes and a table of contents in the \TEX/ file |
| 210 |
output by \.{CWEAVE}. (On by default.) (\.{CWEAVE} only.) |
| 211 |
|
| 212 |
\vfill\eject |
| 213 |
@z |
| 214 |
|
| 215 |
@x l.1123 |
| 216 |
Sometimes things don't work as smoothly, and you get a bunch of |
| 217 |
@y |
| 218 |
\pdffalse\acrohintfalse |
| 219 |
Sometimes things don't work as smoothly, and you get a bunch of |
| 220 |
@z |
| 221 |
|
| 222 |
@x l.1131 |
| 223 |
`$\\{main}(\\{argc},\39\\{argv}{}$)'. |
| 224 |
@y |
| 225 |
`$\\{main}(\\{argc},\39\\{argv}{}$)'. |
| 226 |
\ifx\pdf+\pdftrue\fi \ifxetex\pdftrue\fi |
| 227 |
\ifpdflua\ifnum\pdfoutput>0\pdftrue\fi\fi |
| 228 |
\ifpdf\acrohinttrue\fi \ifhint\acrohinttrue\fi |
| 229 |
@z |
| 230 |
|
| 231 |
@x l.1141 |
| 232 |
the `\.{@\#}' will put extra space after `$\langle\,$Other locals$\,\rangle$'. |
| 233 |
@y |
| 234 |
the `\.{@\#}' will put extra space after `$\langle\,$Other locals$\,\rangle$'.% |
| 235 |
\cwebfootnote{This extended version of \.{CWEB} acknowledges the \.{-o} option |
| 236 |
to suppress the extra space globally.} |
| 237 |
@z |
| 238 |
|
| 239 |
@x l.1143 |
| 240 |
\section Hypertext and hyperdocumentation. |
| 241 |
@y |
| 242 |
\vfill\eject |
| 243 |
\section Hypertext and hyperdocumentation. |
| 244 |
@z |
| 245 |
|
| 246 |
@x l.1167 |
| 247 |
from \.{https://hint.userweb.mwn.de/hint/hintview.html}. |
| 248 |
@y |
| 249 |
from |
| 250 |
\pdfURL{\.{https://hint.userweb.mwn.de/hint/hintview.html}}% |
| 251 |
{https://hint.userweb.mwn.de/hint/hintview.html}.% |
| 252 |
@z |
| 253 |
|
| 254 |
@x l.1176 |
| 255 |
the program sources at \.{ftp://ftp.cs.stanford.edu/pub/ctwill}. |
| 256 |
@y |
| 257 |
the program sources at |
| 258 |
\pdfURL{\.{http://ftp.cs.stanford.edu/pub/ctwill}}% |
| 259 |
{http://ftp.cs.stanford.edu/pub/ctwill}.% |
| 260 |
\cwebfootnote{\TeX~Live comes with an up-to-date |
| 261 |
\.{ctwill} executable -- and its associated helpers -- out of the box.} |
| 262 |
@z |
| 263 |
|
| 264 |
@x l.1180 |
| 265 |
As an example of a real program written in \.{CWEB}, Appendix~A |
| 266 |
@y |
| 267 |
As an example of a real program written in \.{CWEB}, \Appendix A |
| 268 |
@z |
| 269 |
|
| 270 |
@x l.1185 |
| 271 |
Appendix B displays the files that set \TEX/ up to accept |
| 272 |
the output of \.{CWEAVE}, and Appendix~C discusses how to use some of those |
| 273 |
@y |
| 274 |
\Appendix B displays the files that set \TEX/ up to accept |
| 275 |
the output of \.{CWEAVE}, and \Appendix C discusses how to use some of those |
| 276 |
@z |
| 277 |
|
| 278 |
@x l.1191 |
| 279 |
appendices D, E, and~F, which exhibit the complete source code for |
| 280 |
\.{CTANGLE} and \.{CWEAVE}. |
| 281 |
|
| 282 |
\vfil\eject\titletrue |
| 283 |
@y |
| 284 |
appendices \pdfURL{D}{common.pdf}, \pdfURL{E}{ctangle.pdf}, |
| 285 |
and~\pdfURL{F}{cweave.pdf}, which exhibit the complete source code for |
| 286 |
\.{CTANGLE} and \.{CWEAVE}.% |
| 287 |
\cwebfootnote{Actually, \pdfURL{Appendix~D}{common.pdf} contains the source |
| 288 |
code for \.{COMMON}, and the additional \pdfURL{Appendix~G}{ctwill.pdf} |
| 289 |
exhibits the source code for \.{CTWILL}, which is based on \.{CWEAVE}.} |
| 290 |
|
| 291 |
\vfill\eject\titletrue |
| 292 |
@z |
| 293 |
|
| 294 |
@x l.1197 |
| 295 |
\section Appendix A: Excerpts from a \.{CWEB} Program. |
| 296 |
@y |
| 297 |
\def\subsections{4} |
| 298 |
\section Appendix A: Excerpts from a \.{CWEB} Program. |
| 299 |
\subsection CWEB file format. |
| 300 |
@z |
| 301 |
|
| 302 |
@x l.1201 |
| 303 |
generated sections 27--31 of the file \.{common.w}, which contains |
| 304 |
@y |
| 305 |
generated sections 27--31 of the file |
| 306 |
\pdfURL{\.{common.w}}{common.pdf}, which contains |
| 307 |
@z |
| 308 |
|
| 309 |
@x l.1272 |
| 310 |
\def\runninghead{APPENDIX A --- TRANSLATION BY {\ninett CTANGLE}} |
| 311 |
@y |
| 312 |
\def\runninghead{APPENDIX A --- TRANSLATION BY {\ninett CTANGLE}} |
| 313 |
\subsection Translation by CTANGLE. |
| 314 |
@z |
| 315 |
|
| 316 |
@x l.1340 |
| 317 |
\def\runninghead{APPENDIX A --- TRANSLATION BY {\ninett CWEAVE}} |
| 318 |
@y |
| 319 |
\def\runninghead{APPENDIX A --- TRANSLATION BY {\ninett CWEAVE}} |
| 320 |
\subsection Translation by CWEAVE. |
| 321 |
@z |
| 322 |
|
| 323 |
@x l.1429 |
| 324 |
\def\runninghead{APPENDIX A --- FINAL DOCUMENT} |
| 325 |
|
| 326 |
And here's what the same excerpt looks like when typeset. |
| 327 |
(Can you spot the typographical nicety used in the \.{CWEB} code?) |
| 328 |
\let\K=\leftarrow |
| 329 |
@y |
| 330 |
\def\runninghead{APPENDIX A --- FINAL DOCUMENT} |
| 331 |
\subsection Final document. |
| 332 |
|
| 333 |
\pdffalse\acrohintfalse |
| 334 |
And here's what the same excerpt looks like when typeset. |
| 335 |
(Can you spot the typographical niceties used in the \.{CWEB} code?) |
| 336 |
\let\K=\leftarrow |
| 337 |
\def\C#1{\5\5\quad$\triangleright\,${\cmntfont#1}$\,\triangleleft$} |
| 338 |
@z |
| 339 |
|
| 340 |
@x l.1511 |
| 341 |
\vfil\eject\titletrue |
| 342 |
@y |
| 343 |
\vfill\eject\titletrue |
| 344 |
\ifx\pdf+\pdftrue\fi \ifxetex\pdftrue\fi |
| 345 |
\ifpdflua\ifnum\pdfoutput>0 \pdftrue\fi\fi |
| 346 |
\ifacro\acrohinttrue\fi \ifhint\acrohinttrue\fi |
| 347 |
@z |
| 348 |
|
| 349 |
@x l.1613 |
| 350 |
\.{ { }\\vskip 15pt \\centerline\{(Version 4.12.2)\}{ }\\vfill\}}\cr}$$ |
| 351 |
@y |
| 352 |
\.{ { }\\vskip 15pt \\centerline\{(Version 4.12.2)\}{ }\\vfill\}}\cr}$$ |
| 353 |
@z |
| 354 |
|
| 355 |
@x l.1728 |
| 356 |
if you have a duplex printer. Appendices D, E, and F of the complete |
| 357 |
version of this manual are printed using a commented-out option that |
| 358 |
substitutes `$\gets$' for `$=$' in the program listings. Looking at those |
| 359 |
@y |
| 360 |
if you have a duplex printer. Appendices \pdfURL{D}{common.pdf}, |
| 361 |
\pdfURL{E}{ctangle.pdf}, and \pdfURL{F}{cweave.pdf}\cwebfootnote{And |
| 362 |
\pdfURL{Appendix~G}{ctwill.pdf}.} of the complete |
| 363 |
version of this manual are printed using a commented-out option that |
| 364 |
substitutes `$\gets$' for `$=$' in the program listings.\cwebfootnote{They |
| 365 |
also make use of the alternative format for \CEE/ comments.} |
| 366 |
Looking at those |
| 367 |
@z |
| 368 |
|
| 369 |
@x l.1780 |
| 370 |
\point 20. Furthermore, group titles can be converted to an arbitrary |
| 371 |
@y |
| 372 |
\vfill\eject |
| 373 |
\point 20. Furthermore, group titles can be converted to an arbitrary |
| 374 |
@z |
| 375 |
|
| 376 |
@x l.1791 |
| 377 |
\bye |
| 378 |
@y |
| 379 |
\point 21. With modern \TeX\ engines like `\.{luatex}', `\.{pdftex}', and |
| 380 |
`\.{xetex}' (but \\{not} with classic `\.{tex}') you can say `\.{\\input |
| 381 |
pdfwebtocfront}' as the last command in the limbo section and run \TeX\ |
| 382 |
\\{twice} on your woven \.{CWEB} document, in order to shift the |
| 383 |
table-of-contents to the front of the {\mc PDF} output. |
| 384 |
\bye |
| 385 |
@z |