Skip to content

Commit

Permalink
Tuneup for CWEB 4.12.1.
Browse files Browse the repository at this point in the history
Features:

* Fix a few sorting errors in the "Names of the sections".
* Rename PDF page dimensions in [pdf]ctwimac.tex.
* Append 'Names of the sections' at the end of CTWILL PDF output.
  • Loading branch information
ascherer committed Jan 1, 2025
1 parent 01d85dd commit 6fc4188
Show file tree
Hide file tree
Showing 33 changed files with 265 additions and 135 deletions.
6 changes: 3 additions & 3 deletions 0001-Support-extended-syntax-for-numeric-literals.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From ba514ca2a52ab65e46d3477724672564cb492646 Mon Sep 17 00:00:00 2001
From 07e8fcc3d675a01043c97d1ae01df3eff2745399 Mon Sep 17 00:00:00 2001
From: Andreas Scherer <[email protected]>
Date: Mon, 29 Mar 2021 13:14:34 +0200
Subject: [PATCH 1/5] Support extended syntax for numeric literals.
Subject: [PATCH 1/6] Support extended syntax for numeric literals.

---
ctwimac.tex | 15 ++++++++++-----
Expand Down Expand Up @@ -90,5 +90,5 @@ index 29533b8..dbcf312 100644
\hbox{\strut\kern2pt\.{#1}\kern2pt}}
\hrule}\vrule\kern2pt}} % verbatim string
--
2.41.0
2.47.1

6 changes: 3 additions & 3 deletions 0002-Purge-redundant-TeX-macro.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a5ee9d7e41df5d084cdbd23a9e43cdd9e31c1e6c Mon Sep 17 00:00:00 2001
From e915d4e570ec3d56765317862eb3b664dbf764c1 Mon Sep 17 00:00:00 2001
From: Andreas Scherer <[email protected]>
Date: Thu, 8 Apr 2021 14:44:11 +0200
Subject: [PATCH 2/5] Purge redundant '\TeX' macro.
Subject: [PATCH 2/6] Purge redundant '\TeX' macro.

---
ctwimac.tex | 5 +----
Expand Down Expand Up @@ -68,5 +68,5 @@ index 99ae604..89e3b68 100644
\let\mc=\ninerm % medium caps
\def\CEE/{{\mc C\spacefactor1000}}
--
2.41.0
2.47.1

6 changes: 3 additions & 3 deletions 0003-Adapt-to-CWEB-4.5.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From eb98776596c3d9504243de133819946540fa609a Mon Sep 17 00:00:00 2001
From 2ee035a94ad155cd244afe6f35b483eb02d818de Mon Sep 17 00:00:00 2001
From: Andreas Scherer <[email protected]>
Date: Wed, 7 Jul 2021 13:57:00 +0200
Subject: [PATCH 3/5] Adapt to CWEB 4.5.
Subject: [PATCH 3/6] Adapt to CWEB 4.5.

---
ctwimac.tex | 40 ++++++++++++++++++++--------------------
Expand Down Expand Up @@ -266,5 +266,5 @@ index 89e3b68..6d9ac2f 100644
\def\normaloutput#1{\shipout\vbox{
\vbox to 3pc{\ifodd\pageno\rightheadline\else\leftheadline\fi\vfill}
--
2.41.0
2.47.1

6 changes: 3 additions & 3 deletions 0004-Add-silent-datecontentspage-macro.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From e1d2ad3d3bde4a6d5611b4627a9feb43118a87fa Mon Sep 17 00:00:00 2001
From abcfe710f5d5ce3b6801e391ac57105046cb446e Mon Sep 17 00:00:00 2001
From: Andreas Scherer <[email protected]>
Date: Thu, 10 Feb 2022 09:24:39 +0100
Subject: [PATCH 4/5] Add silent \datecontentspage macro.
Subject: [PATCH 4/6] Add silent \datecontentspage macro.

---
ctwimac.tex | 2 +-
Expand All @@ -21,5 +21,5 @@ index df24900..014168b 100644
% To produce only a subset of pages, put the page numbers on separate
% lines in a file called pages.tex
--
2.41.0
2.47.1

6 changes: 3 additions & 3 deletions 0005-Update-CTWILL-macros-for-CWEB-4.9.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 6b42e6c76f705f1adc9ef62ddc63318df9676d42 Mon Sep 17 00:00:00 2001
From 9352f2538be0025a86ecee2f3fac4222d756483a Mon Sep 17 00:00:00 2001
From: Andreas Scherer <[email protected]>
Date: Wed, 14 Jun 2023 10:00:33 +0200
Subject: [PATCH 5/5] Update CTWILL macros for CWEB 4.9.
Subject: [PATCH 5/6] Update CTWILL macros for CWEB 4.9.

---
ctwimac.tex | 10 ++++++----
Expand Down Expand Up @@ -109,5 +109,5 @@ index 6d9ac2f..6865478 100644
% \L is Polish letter suppressed-L; we have no shorthand for \le
% \O is Scandinavian letter O-with-slash
--
2.41.0
2.47.1

94 changes: 94 additions & 0 deletions 0006-Rename-page-dimensions-to-match-cwebmac.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
From 88a5e5237f615d94a3ea3f6c8e8d7391969198e5 Mon Sep 17 00:00:00 2001
From: debbuild <debbuild>
Date: Fri, 27 Dec 2024 11:35:30 +0100
Subject: [PATCH 6/6] Rename page dimensions to match cwebmac.

---
ctwimac.tex | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/ctwimac.tex b/ctwimac.tex
index d65f5bf..a7978d8 100644
--- a/ctwimac.tex
+++ b/ctwimac.tex
@@ -259,16 +259,16 @@
% \L is Polish letter suppressed-L
\outer\def\M#1{\def\secno{#1}\startsection\ignorespaces}
\outer\def\N{\ifvoid\partialpage\lefttrue
- \else\ifdim\ht\partialpage<\pageht \leftfalse\else\lefttrue\fi\fi\NNN}
+ \else\ifdim\ht\partialpage<\pageheight \leftfalse\else\lefttrue\fi\fi\NNN}
\outer\def\NN{\ifvoid\partialpage\leftfalse
- \else\ifdim\ht\partialpage<\pageht \lefttrue\else\leftfalse\fi\fi\NNN}
+ \else\ifdim\ht\partialpage<\pageheight \lefttrue\else\leftfalse\fi\fi\NNN}
\outer\def\NNN#1#2#3.{% beginning of starred section
\gdepth=#1\gtitle={#3}\def\secno{#2}
\ifleft \flushout
\gdef\rlhead{\let\i=I\uppercase{\ignorespaces#3}} % running left headline
\global\let\rrhead=\rlhead % running right headline
\else\global\setbox\partialpage=\vbox{
- \vbox to\pageht{\unvbox\partialpage\vfill}\break}
+ \vbox to\pageheight{\unvbox\partialpage\vfill}\break}
\gdef\rrhead{\let\i=I\uppercase{\ignorespaces#3}}
\fi
\message{*\secno} % progress report
@@ -315,12 +315,12 @@
% \count and \toks registers 200--219 are also used to keep track of refs
\catcode`\@=11
\newcount\@n \newcount\@m \newcount\@p
-\newdimen\pageht \pageht=19cm
-\newdimen\pagewd \pagewd=13cm
-\newdimen\colwd \colwd=\pagewd
+\newdimen\pageheight \pageheight=19cm
+\newdimen\pagewidth \pagewidth=13cm
+\newdimen\colwd \colwd=\pagewidth
\advance\colwd by -2pc \divide\colwd by 3 % for three columns
-\newdimen\fullpageht \fullpageht=\pageht \advance\fullpageht by 4pc
-\newdimen\pagethresh \pagethresh=2\pageht
+\newdimen\fullpageheight \fullpageheight=\pageheight \advance\fullpageheight by 4pc
+\newdimen\pagethresh \pagethresh=2\pageheight
\newdimen\nsize \newdimen\msize
\newskip\intersecskip \intersecskip=8pt plus 2pt minus 3pt
\newbox\partialpage
@@ -331,7 +331,7 @@
\newif\iftitle \newif\ifleft

\def\flushout{\ifvoid\partialpage\else
- \setbox0=\vsplit\partialpage to \pageht
+ \setbox0=\vsplit\partialpage to \pageheight
\shipout\vbox{
\vbox to 3pc{\leftheadline\vfill}
\nointerlineskip\box0}
@@ -345,7 +345,7 @@
\hyphenpenalty 10000 \exhyphenpenalty 10000
\noindent\vbox to1pt{}\par % 1pt = \topskip - \ninept
\readin}
- \shipout\vbox to\fullpageht{
+ \shipout\vbox to\fullpageheight{
\vbox to 3pc{\rightheadline\vfill}
\unvbox\partialpage
\vfill
@@ -364,10 +364,10 @@
\@n=199 \loop \ifnum\@n<222 \toks\@n={} \count\@n=0 \advance\@n 1 \repeat
\nrefs=0
\baseno=\secno}}
-\def\leftheadline{\hbox to\pagewd{\vbox to10pt{}%
+\def\leftheadline{\hbox to\pagewidth{\vbox to10pt{}%
\iftitle\global\titlefalse\else\ninerm\title:\enspace \eightsl\rlhead\fi
\hfil\eightrm\folio}}
-\def\rightheadline{\hbox to\pagewd{\vbox to10pt{}%
+\def\rightheadline{\hbox to\pagewidth{\vbox to10pt{}%
\eightrm\folio\hfil\ninerm\title:\enspace \eightsl\rrhead\/}}

\def\mini{\begingroup \obeylines \globaldefs=1 \newrefs=\bgroup}
@@ -448,7 +448,7 @@
\def\donewithpage#1 {\let\readin=\relax}
\catcode`\@=12

-\hsize=\pagewd \vsize=\maxdimen \output={\twillout}
+\hsize=\pagewidth \vsize=\maxdimen \output={\twillout}

\def\inx{\flushout\end}
\def\fin{\parfillskip 0pt plus 1fil
--
2.47.1

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[cweb system](http://www-cs-faculty.stanford.edu/~uno/cweb.html)
and donald e. knuth's [ctwill program](http://ftp.cs.stanford.edu/pub/ctwill).
it requires the contents of [the original *cweb* source
drop](https://github.com/ascherer/cweb/releases/download/cweb-4.12/cweb-4.12.tar.gz)
drop](https://github.com/ascherer/cweb/releases/download/cweb-4.12.1/cweb-4.12.1.tar.gz)
and [the secondary *ctwill* source
drop](http://ftp.cs.stanford.edu/pub/ctwill/ctwill.tar.gz), to which it applies
a set of change files to introduce advanced features. see the extensive
Expand All @@ -23,11 +23,11 @@ a set of change files to introduce advanced features. see the extensive

## manual compilation

extract `ctwill.tar.gz` and add the contents of `cweb-4.12.tar.gz` (overwriting
extract `ctwill.tar.gz` and add the contents of `cweb-4.12.1.tar.gz` (overwriting
outdated source files `Makefile`, `common.h`, `common.w`, and `prod.w`) and
`cwebbin-2024.tar.gz` for the full set of source files.
`cwebbin-2025.tar.gz` for the full set of source files.
replace `@@VERSION@@` in line 129 of the `Makefile.unix` with something like
`Version 4.12 [CWEBbin 2024]`.
`Version 4.12.1 [CWEBbin 2025]`.
`touch *.cxx`.
unix/linux users should work with [`make -f Makefile.unix`](Makefile.unix)
exclusively (targets `boot`, `cautiously`, and `all`).
Expand All @@ -47,8 +47,8 @@ clone
[cweb](https://github.com/ascherer/cweb) and
[cwebbin](https://github.com/ascherer/cwebbin), create the source drops with
```
git archive -o cweb-4.12.tar.gz cweb-4.12
git archive -o cwebbin-2024.tar.gz cwebbin-2024
git archive -o cweb-4.12.1.tar.gz cweb-4.12.1
git archive -o cwebbin-2025.tar.gz cwebbin-2025
```
respectively, put these two tarballs and the original `ctwill.tar.gz` in the
*SOURCES* directory, add the patch files
Expand Down Expand Up @@ -96,5 +96,5 @@ macros, and cweb include files.
updated versions of **cweb** are added to the texlive source tree with
```
cd /path/to/texlive-source/texk/web2c/cwebdir
pax -rzf /path/to/cweb-4.12.tar.gz
pax -rzf /path/to/cweb-4.12.1.tar.gz
```
6 changes: 3 additions & 3 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-*-Text-*-
%%% LEGALESE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% This file is part of CWEBbin (Version 4.12 [2024]).
% This file is part of CWEBbin (Version 4.12.1 [2025]).
% (Set TAB to 8 spaces to get the spacing right.)
% The CWEB programs by Silvio Levy are based on programs by D. E. Knuth.
% They are distributed WITHOUT ANY WARRANTY, express or implied.

% This README file was last updated August 12, 2024 by Andreas Scherer.
% This README file was last updated January 1, 2025 by Andreas Scherer.

% The following copyright notices extend to the respective parts of the
% changed or added source code introduced in this patch only, not to the
Expand All @@ -16,7 +16,7 @@
% Copyright (C) 1991-1993 Hans-Hermann Bode
% Copyright (C) 1992 Klaus Guntermann
% Copyright (C) 1991,1993 Carsten Steger
% Copyright (C) 1993-2000,2005,2011,2018–2024 Andreas Scherer
% Copyright (C) 1993-2000,2005,2011,2018–2025 Andreas Scherer

% Permission is granted to make and distribute verbatim copies of this
% document provided that the copyright notice and this permission notice
Expand Down
4 changes: 2 additions & 2 deletions comm-mini.ch
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Limbo.

@x
\def\title{Common code for CTANGLE and CWEAVE (4.12 [\TeX~Live])}
\def\title{Common code for CTANGLE and CWEAVE (4.12.1 [\TeX~Live])}
@y
\def\title{COMMON (4.12 [\TeX~Live])}
\def\title{COMMON (4.12.1 [\TeX~Live])}
\def\contentspagenumber{0}
@z

Expand Down
9 changes: 5 additions & 4 deletions comm-patch.ch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-*-Web-*-
This file, COMM-FOO.CH, is part of CWEBBIN (@VERSION@).
It is a changefile for COMMON.W, Version 4.12.
It is a changefile for COMMON.W, Version 4.12.1.

Technically, COMM-FOO.CH is constructed from a multitude of separate change
files by applying Klaus Guntermann's TIE processor. Any comments (like this
Expand Down Expand Up @@ -34,7 +34,7 @@ This program is distributed WITHOUT ANY WARRANTY, express or implied.
The following copyright notice extends to this changefile only, not to
the masterfile COMMON.W.

Copyright (C) 1993-1995,1998,2000,2005,2018-2024 Andreas Scherer
Copyright (C) 1993-1995,1998,2000,2005,2018-2025 Andreas Scherer
Copyright (C) 1991,1993 Carsten Steger
Copyright (C) 1991-1993 Hans-Hermann Bode

Expand Down Expand Up @@ -188,17 +188,18 @@ p21 29 October 2005 AS ANSI C++ patches to patch level [p21].
02 December 2023 AS Tuneup for CWEB 4.11 [2023].

2024 12 August 2024 AS Tuneup for CWEB 4.12 [2024].
2025 01 January 2025 AS Tuneup for CWEB 4.12.1 [2025].
------------------------------------------------------------------------------
Material in limbo.

@x l.25
\def\title{Common code for CTANGLE and CWEAVE (Version 4.12)}
\def\title{Common code for CTANGLE and CWEAVE (Version 4.12.1)}
@y
\def\title{Common code for CTANGLE and CWEAVE (@VERSION@)}
@z

@x l.30
\centerline{(Version 4.12)}
\centerline{(Version 4.12.1)}
@y
\centerline{(@VERSION@)}
@z
Expand Down
4 changes: 2 additions & 2 deletions comm-texlive.ch
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Material in limbo.
\def\title{Common code for CTANGLE and CWEAVE (@VERSION@)}
@y
\def\Kpathsea/{{\mc KPATHSEA\spacefactor1000}} \ifacro\sanitizecommand\Kpathsea{KPATHSEA}\fi
\def\title{Common code for CTANGLE and CWEAVE (4.12 [\TeX~Live])}
\def\title{Common code for CTANGLE and CWEAVE (4.12.1 [\TeX~Live])}
@z

@x l.30 and l.199 of COMM-PATCH.CH
\centerline{(@VERSION@)}
@y
\centerline{(Version 4.12 [\TeX~Live])}
\centerline{(Version 4.12.1 [\TeX~Live])}
@z

@x l.32
Expand Down
7 changes: 4 additions & 3 deletions ctang-patch.ch
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,18 @@ p21 29 October 2005 AS ANSI C++ patches for patch level [p21].
02 December 2023 AS tuneup for CWEB 4.11 [2023].

2024 12 August 2024 AS tuneup for CWEB 4.12 [2024].
2025 01 January 2025 AS tuneup for CWEB 4.12.1 [2025].
------------------------------------------------------------------------------
Material in limbo.

@x l.30
\def\title{CTANGLE (Version 4.12)}
\def\title{CTANGLE (Version 4.12.1)}
@y
\def\title{CTANGLE (@VERSION@)}
@z

@x l.34
\centerline{(Version 4.12)}
\centerline{(Version 4.12.1)}
@y
\centerline{(@VERSION@)}
@z
Expand All @@ -198,7 +199,7 @@ z
Section 1.

@x l.64
@d banner "This is CTANGLE (Version 4.12)"
@d banner "This is CTANGLE (Version 4.12.1)"
@y
@d banner "This is CTANGLE (@VERSION@)"
@z
Expand Down
6 changes: 3 additions & 3 deletions ctang-texlive.ch
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ Material in limbo.
@x l.30 and CTANG-PATCH.CH
\def\title{CTANGLE (@VERSION@)}
@y
\def\title{CTANGLE (Version 4.12 [\TeX~Live])}
\def\title{CTANGLE (Version 4.12.1 [\TeX~Live])}
@z

@x l.34 and CTANG-PATCH.CH
\centerline{(@VERSION@)}
@y
\centerline{(Version 4.12 [\TeX~Live])}
\centerline{(Version 4.12.1 [\TeX~Live])}
@z

@x l.36
Expand All @@ -38,7 +38,7 @@ Section 1.
@x l.64 and CTANG-PATCH.CH and CTANG-I18N.CH
@d banner _("This is CTANGLE (@VERSION@)")
@y
@d banner "This is CTANGLE, Version 4.12"
@d banner "This is CTANGLE, Version 4.12.1"
/* will be extended by the \TeX~Live |versionstring| */
@z

Expand Down
2 changes: 1 addition & 1 deletion ctangle.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/*:5*/
#line 67 "ctangle.w"

#define banner _("This is CTANGLE (Version 4.12 [CWEBbin 2024])") \
#define banner _("This is CTANGLE (Version 4.12.1 [CWEBbin 2025])") \

#define _(s) gettext(s) \

Expand Down
Loading

0 comments on commit 6fc4188

Please sign in to comment.