summaryrefslogtreecommitdiff
path: root/systems/knuth/local/lib
diff options
context:
space:
mode:
Diffstat (limited to 'systems/knuth/local/lib')
-rw-r--r--systems/knuth/local/lib/10list.tex83
-rw-r--r--systems/knuth/local/lib/6list.tex2
-rw-r--r--systems/knuth/local/lib/cwebmac.tex28
-rw-r--r--systems/knuth/local/lib/domino.mf40
-rw-r--r--systems/knuth/local/lib/gkpmac.tex45
-rw-r--r--systems/knuth/local/lib/letter.tex119
-rw-r--r--systems/knuth/local/lib/letterformat.tex85
-rw-r--r--systems/knuth/local/lib/list-latin.tex30
-rw-r--r--systems/knuth/local/lib/llist-latin.tex84
-rw-r--r--systems/knuth/local/lib/llist.tex2
-rw-r--r--systems/knuth/local/lib/twimac.tex18
11 files changed, 330 insertions, 206 deletions
diff --git a/systems/knuth/local/lib/10list.tex b/systems/knuth/local/lib/10list.tex
new file mode 100644
index 0000000000..9b145b8747
--- /dev/null
+++ b/systems/knuth/local/lib/10list.tex
@@ -0,0 +1,83 @@
+% Makes a 10-column landscape listing of one or more files with narrow lines
+% Typical usage:
+% tex 10list foo \\end
+% and then use gv to print the result (my dvips has trouble with landscape)
+
+\def\grabfile#1 {\setbox0=\lastbox\endgraf\doit{#1}}
+\everypar{\grabfile}
+
+\font\filenamefont= cmtt8 scaled\magstep3
+\font\headlinefont= cmr8
+\font\listingfont= cmtex8
+\font\eoffont= cmti8
+
+\def\today{\ifcase\month\or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or December\fi
+ \space\number\day, \number\year}
+\newcount\m \newcount\n
+\n=\time \divide\n 60 \m=-\n \multiply\m 60 \advance\m \time
+\def\hours{\twodigits\n\twodigits\m}
+\def\twodigits#1{\ifnum #1<10 0\fi \number#1}
+
+\newlinechar=`@
+\message{@\today\space at \hours}
+
+\baselineskip=9pt
+\medskipamount=4pt minus 1pt
+\raggedbottom
+\nopagenumbers
+
+\chardef\other=12
+\def\doit#1{\message{@Listing #1@}
+ \begingroup \everypar{} \frenchspacing
+ \headline{\hbox to10in{\filenamefont#1\quad
+ \headlinefont \today\ at \hours\hskip3in Page \folio\hss}\hss}
+ \def\do##1{\catcode`##1=\other}\dospecials
+ \catcode127=\other \catcode9=\other \catcode12=\other
+ \parindent 0pt \parfillskip=0pt plus 1fil minus .8in
+ \everypar{\hangindent 1in} \rightskip=0pt plus 2in
+ \def\par{\ifvmode\penalty-50\medskip\else\endgraf\fi}
+ \listingfont \obeylines \obeyspaces \global\pageno=1
+ \input #1 {\eoffont(end of\/ file)}\endgraf\vfill\eject
+ \ifright\null\vfill\eject\fi\endgroup}
+{\obeyspaces\global\let =\ }
+\catcode`\_=\other % allow _ in file names
+
+\hsize=.9truein
+\vsize=7truein
+\hoffset=-.5truein
+\voffset=-.2truein
+\newif\ifright
+\newcount\boxnum \boxnum=0
+\output{\ifright\else\ifcase\boxnum
+ \global\setbox0=\vbox{\makeheadline\pagebody\makefootline}\global\boxnum=1\or
+ \global\setbox1=\vbox{\pagebody\makefootline}\global\boxnum=2\or
+ \global\setbox2=\vbox{\pagebody\makefootline}\global\boxnum=3\or
+ \global\setbox3=\vbox{\pagebody\makefootline}\global\boxnum=4\or
+ \global\setbox4=\vbox{\pagebody\makefootline}\global\boxnum=5\or
+ \global\setbox5=\vbox{\pagebody\makefootline}\global\boxnum=6\or
+ \global\setbox6=\vbox{\pagebody\makefootline}\global\boxnum=7\or
+ \global\setbox7=\vbox{\pagebody\makefootline}\global\boxnum=8\or
+ \global\setbox8=\vbox{\pagebody\makefootline}\global\boxnum=9\or
+ \shipout\hbox{\hbox to1truein{\box0\hss}%
+ \hbox to1truein{\box1\hss}%
+ \hbox to1truein{\box2\hss}%
+ \hbox to1truein{\box3\hss}%
+ \hbox to1truein{\box4\hss}%
+ \hbox to1truein{\box5\hss}%
+ \hbox to1truein{\box6\hss}%
+ \hbox to1truein{\box7\hss}%
+ \hbox to1truein{\box8\hss}%
+ \vbox{\pagebody\makefootline}}
+ \advancepageno\global\boxnum=0\fi\fi}
+
+\special{landscape}
+
+% A tab (^^I) prints as lowercase gamma.
+% Character ^^M could be made visible, with a bit of work;
+% at present, it's indistinguishable from newline (^^J).
+
+% You can get up to 63 characters on a line without an overfull box.
+% (But lines with more than 59 characters may overlap with the next column,
+% or be clipped off in the rightmost column.)
diff --git a/systems/knuth/local/lib/6list.tex b/systems/knuth/local/lib/6list.tex
index 5d59194ffe..06c316c254 100644
--- a/systems/knuth/local/lib/6list.tex
+++ b/systems/knuth/local/lib/6list.tex
@@ -36,7 +36,7 @@
\def\do##1{\catcode`##1=\other}\dospecials
\catcode127=\other \catcode9=\other \catcode12=\other
\parindent 0pt \parfillskip=0pt plus 1fil minus .8in
- \everypar{\hangindent 1in} \rightskip=0pt plus 2in
+ \everypar{\hangindent 6pt} \rightskip=0pt plus 2in
\def\par{\ifvmode\penalty-50\medskip\else\endgraf\fi}
\listingfont \obeylines \obeyspaces \global\pageno=1
\input #1 {\eoffont(end of\/ file)}\endgraf\vfill\eject
diff --git a/systems/knuth/local/lib/cwebmac.tex b/systems/knuth/local/lib/cwebmac.tex
index 8890b63b4d..60f86ce5a9 100644
--- a/systems/knuth/local/lib/cwebmac.tex
+++ b/systems/knuth/local/lib/cwebmac.tex
@@ -1,8 +1,8 @@
% standard macros for CWEB listings (in addition to plain.tex)
-% Version 3.67 --- July 2006
+% Version 3.70 --- July 2017
\ifx\renewenvironment\undefined\else\endinput\fi % LaTeX will use other macros
-\xdef\fmtversion{\fmtversion+CWEB3.67}
-\chardef\cwebversion=3 \chardef\cwebrevision=67
+\xdef\fmtversion{\fmtversion+CWEB3.70}
+\chardef\cwebversion=3 \chardef\cwebrevision=70
\newif\ifpdf
\ifx\pdf+\pdftrue\fi
% Uncomment the following line if you want PDF goodies to be the default
@@ -10,7 +10,11 @@
\def\pdflinkcolor{0 0 1} % the RGB values for hyperlink color
\newif\ifpdftex
\ifx\pdfoutput\undefined \pdftexfalse \else\ifnum\pdfoutput=0 \pdftexfalse
-\else \pdftextrue \pdfoutput=1 \input pdfcolor \let\setcolor\pdfsetcolor \fi\fi
+%\else \pdftextrue \pdfoutput=1 \input pdfcolor \let\setcolor\pdfsetcolor \fi\fi
+\else \pdftextrue \pdfoutput=1 % changed in 3.69
+ \def\Black{\pdfliteral{0 g 0 G}} % use rgb colors for direct PDF output too
+ \def\Blue{\pdfliteral{0 0 1 rg 0 0 1 RG}}
+\fi\fi
\newif\ifacro \ifpdf\acrotrue\fi \ifpdftex\acrotrue\fi
\let\:=\. % preserve a way to get the dot accent
@@ -136,7 +140,7 @@
\ifpdftex
\ifx\pdfannotlink\undefined\let\pdfannotlink\pdfstartlink\fi% for pdfTeX 0.14
\def\pdflink#1#2{\hbox{\pdfannotlink height\ht\strutbox depth\dp\strutbox
- attr{/Border [0 0 0]} goto num #1 \BlueGreen #1\Black\pdfendlink}}
+ attr{/Border [0 0 0]} goto num #1 \Blue #1\Black\pdfendlink}} % changed 3.69
\else\def\pdflink#1#2{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
\special{pdf: ec}}\special{pdf: ann width \thewidth height \theheight
depth \thedepth << /Type /Annot /Subtype /Link
@@ -166,7 +170,7 @@
\def\maketoksdone{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
\def\pdfURL#1#2{\ifpdftex\pdfannotlink height\ht\strutbox depth\dp\strutbox
attr {/Border [0 0 0]} user { /Type /Action /Subtype /Link /A
- << /S /URI /URI (#2) >>}\BlueGreen #1\Black \pdfendlink
+ << /S /URI /URI (#2) >>}\Blue #1\Black \pdfendlink % changed in 3.69
\else \ifpdf{\setbox0=\hbox{\special{pdf: bc [ \pdflinkcolor ]}{#1}%
\special{pdf: ec}}\special{pdf: ann width \thewidth\space height \theheight
\space depth \thedepth\space << /Border [0 0 0]
@@ -278,7 +282,8 @@
\sfcode`;=1500 \pretolerance 200 \hyphenpenalty 50 \exhyphenpenalty 50
\noindent{\let\*=\lapstar\bf\secstar.\quad}%
\ifpdftex\smash{\raise\baselineskip\hbox to0pt{%
- \let\*=\empty\pdfdest num \secstar fith}}
+% \let\*=\empty\pdfdest num \secstar fith}} % bad space in versions < 3.68
+ \let\*=\empty\pdfdest num \secstar fith}}% changed in version 3.68
\else\ifpdf\smash{\raise\baselineskip\hbox to0pt{%
\let\*=\empty\special{%
pdf: dest (\romannumeral\secstar) [ @thispage /FitH @ypos ]}}}\fi\fi}
@@ -340,7 +345,7 @@
\def\T#1{\leavevmode % octal, hex or decimal constant
\hbox{$\def\?{\kern.2em}%
% \def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant % versions < 3.67
- \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant
+ \def\$##1{\egroup_{\rm##1}\bgroup}% suffix to constant % in version 3.67
\def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick)
\let\~=\oct \let\^=\hex {#1}$}}
\def\U{\note{This code is used in section}} % xref for use of a section
@@ -407,7 +412,8 @@
\newdimen\pagewidth \pagewidth=6.5in % the width of each page
\newdimen\pageheight \pageheight=8.7in % the height of each page
\newdimen\fullpageheight \fullpageheight=9in % page height including headlines
-\newdimen\pageshift \pageshift=0in % shift righthand pages wrt lefthand ones
+\newdimen\pageshift \pageshift=\hoffset
+ % shift righthand pages wrt lefthand ones (changed in version 3.70)
\def\magnify#1{\mag=#1\pagewidth=6.5truein\pageheight=8.7truein
\fullpageheight=9truein\setpage}
\def\setpage{\hsize\pagewidth\vsize\pageheight} % use after changing page size
@@ -457,6 +463,7 @@
\def\fin{\par\vfill\eject % this is done when we are ending the index
\ifpagesaved\null\vfill\eject\fi % output a null index column
\if L\lr\else\null\vfill\eject\fi % finish the current page
+ \ifpdftex \makebookmarks \fi % added in Version 3.68
\parfillskip 0pt plus 1fil
\def\grouptitle{NAMES OF THE SECTIONS}
\let\topsecno=\nullsec
@@ -470,7 +477,8 @@
\def\Us{\note{Used in sections}} % crossref for uses of a section
\def\I{\par\hangindent 2em}\let\*=*
\ifacro \def\outsecname{Names of the sections} \let\Xpdf\X
- \ifpdftex \makebookmarks \pdfdest name {NOS} fitb
+% \ifpdftex \makebookmarks \pdfdest name {NOS} fitb % in versions < 3.68
+ \ifpdftex \pdfdest name {NOS} fith % changed in version 3.69
\pdfoutline goto name {NOS} count -\secno {\outsecname}
\def\X##1:##2\X{\Xpdf##1:##2\X \firstsecno##1.%
{\toksF={}\makeoutlinetoks##2\outlinedone\outlinedone}%
diff --git a/systems/knuth/local/lib/domino.mf b/systems/knuth/local/lib/domino.mf
index 6bd9da121b..578110eb32 100644
--- a/systems/knuth/local/lib/domino.mf
+++ b/systems/knuth/local/lib/domino.mf
@@ -14,41 +14,49 @@
% instead of 16,32,48. But the present scheme seems mathematically better.
mode_setup;
p#:=in#/300;
-d#:=64p#;
+%d#:=64p#;
+d#:=63p#; % changed September 2016 (makes the font slightly smaller)
define_pixels(p);
font_identifier:="DOMINO";
font_coding_scheme:="dominoes";
font_size:=10pt#;
+font_quad:=d#;
+font_normal_space:=d#;
-pickup pencircle scaled p; tiny_pen=savepen;
+pickup pencircle scaled .5p; tiny_pen=savepen;
pickup pencircle scaled 13p; huge_pen=savepen;
% I first tried 15p, and it looked OK, but the Taiwan set has smaller dots
-pickup pencircle scaled 3p; bound_pen=savepen;
def begindomchar(expr code)=
beginchar(code,d#,d#,0);
pickup tiny_pen;
- for x=0 step 2p until 60p:
- drawdot (x+.5p,1.5p); drawdot (x+1.5p,.5p);
- drawdot (.5p,x+3.5p); drawdot (1.5p,x+2.5p);
- drawdot (w-1.5p,x+1.5p); drawdot (w-.5p,x+.5p);
- drawdot (x+2.5p,h-.5p); drawdot (x+3.5p,h-1.5p);
+% for x=0 step 2p until 60p:
+% drawdot (x+.5p,1.5p); drawdot (x+1.5p,.5p);
+% drawdot (.5p,x+3.5p); drawdot (1.5p,x+2.5p);
+% drawdot (w-1.5p,x+1.5p); drawdot (w-.5p,x+.5p);
+% drawdot (x+2.5p,h-.5p); drawdot (x+3.5p,h-1.5p);
+% September 2016: that approach gave bad effect at join between domino halves
+ for x=0 step 3p until 57p:
+ drawdot (x+1.5p,1.5p);
+ drawdot (w-1.5p,x+1.5p);
+ drawdot (w-1.5p-x,h-1.5p);
+ drawdot (1.5p,h-1.5p-x);
endfor
% fill (2p,2p)--(w-2p,2p)--(w-2p,h-2p)--(2p,h-2p)--cycle;
fill (3p,3p)--(w-3p,3p)--(w-3p,h-3p)--(3p,h-3p)--cycle;
pickup huge_pen;
enddef;
-def dota = erase drawdot(16p,48p) enddef;
-def dotb = erase drawdot(32p,48p) enddef;
-def dotc = erase drawdot(48p,48p) enddef;
-def dotd = erase drawdot(16p,32p) enddef;
-def dote = erase drawdot(32p,32p) enddef;
-def dotf = erase drawdot(48p,32p) enddef;
+def dota = erase drawdot(16p,47p) enddef;
+def dotb = erase drawdot(31.5p,47p) enddef;
+def dotc = erase drawdot(47p,47p) enddef;
+def dotd = erase drawdot(16p,31.5p) enddef;
+def dote = erase drawdot(31.5p,31.5p) enddef;
+def dotf = erase drawdot(47p,31.5p) enddef;
def dotg = erase drawdot(16p,16p) enddef;
-def doth = erase drawdot(32p,16p) enddef;
-def doti = erase drawdot(48p,16p) enddef;
+def doth = erase drawdot(31.5p,16p) enddef;
+def doti = erase drawdot(47p,16p) enddef;
def v(expr code)=128+ASCII code enddef;
% change character code for vertical format
diff --git a/systems/knuth/local/lib/gkpmac.tex b/systems/knuth/local/lib/gkpmac.tex
index 1ae0f1a7a6..5b143505a2 100644
--- a/systems/knuth/local/lib/gkpmac.tex
+++ b/systems/knuth/local/lib/gkpmac.tex
@@ -4,12 +4,12 @@
% Fonts for regular text
-\font\textrm=ccr10 % roman
-\font\textit=ccti10 % italic (emphasis)
-\font\textsl=ccsl10 % slanted (titles)
-\font\textbf=cmbx10 % bold
-\font\textcsc=cccsc10 % caps and small caps
-\font\oldsty=ccmi10 % equation numbers
+\font\textrm=ccr10 % roman
+\font\textit=ccti10 % italic (emphasis)
+\font\textsl=ccsl10 % slanted (titles)
+\font\textbf=cmbx10 % bold
+\font\textcsc=cccsc10 % caps and small caps
+\font\oldsty=ccmi10 % equation numbers
\font\twelvett=cmtt12
% Fonts for regular math
@@ -266,8 +266,8 @@
\smallskip\noindent}
\def\beginsection#1 #2 \par{ % should not be first in the chapter
- \backup=\lastskip % but should come on first or second page of chapter
- \mark{#1\enspace #2} % because the mark gives running head on right page
+ \backup=\lastskip % but should come on first or second page of chapter
+ \mark{#1\enspace #2} % because the mark gives running head on right page
\nobreak\vskip-\backup\penalty-200
{\subtitle\baselineskip=34pt
\noindent\hbox to2\parindent{#1\hfil}\uppercase{\kern-.05em#2}\par}
@@ -413,8 +413,8 @@
\def\copyrite{\ifpreprint{\textfont2=\sevensy\sevenrm\copyright\ 1988
Addison-Wesley Publishing Company; all rights reserved}\fi}
-\newdimen\htrimsize \htrimsize=7.5in
-\newdimen\vtrimsize \vtrimsize=9.1875in
+\newdimen\htrimsize \htrimsize=7.375in
+\newdimen\vtrimsize \vtrimsize=9.25in
\newdimen\outermargin \outermargin=23mm
\newdimen\topmargin \topmargin=10mm % plus height of the headline box
\newbox\htrim \newbox\vtrim \newbox\trimmarks
@@ -438,14 +438,15 @@
\vbox to\vtrimsize{\kern\topmargin\fi
\vbox to\totheight{
\offinterlineskip % butt the boxes together
+ \vskip2.5pt % adjustment at the top (10 Jan 2011)
\vbox to 2pc{ % this part goes on top of the regular pages
\ifodd\pageno \rightheadline\else\leftheadline\fi
\vfill} % this completes the \vbox to 2pc
\ifodd\pageno\moveright7pc\fi #1
\vfill
\iftitle \global\titlefalse % reset the titlepage switch
- \ifodd\pageno \hbox to35pc{\hfil\foliofont\folio}
- \else\hbox{\foliofont\folio}\fi\fi
+ \ifodd\pageno \hbox to35pc{\hfil\foliofont\folio}
+ \else\hbox{\foliofont\folio}\fi\fi
\ifpreprint\ifinxmode\makeinxfooter\fi\fi
\iffinal % finish the trimmed page
}\vfill}\ifodd\pageno\hskip\outermargin\else\hss\fi
@@ -489,9 +490,9 @@
\catcode`\|=\active
\expandafter\def\expandafter\dospecials\expandafter{\dospecials\do\|}
-\newcount\defcount % number of old definitions not yet repeated
-\newcount\changecount % number of new definitions that are changed
-\newcount\miscount % number of unknown references
+\newcount\defcount % number of old definitions not yet repeated
+\newcount\changecount % number of new definitions that are changed
+\newcount\miscount % number of unknown references
\newread\tempin
\def\refin#1 {\openin\tempin=#1.ref
@@ -763,6 +764,7 @@
\def\And{\quad{\rm and}\quad}
\let\==\equiv
\def\tmod#1{(mod~$#1$)}
+\def\pmod#1{\allowbreak\mkern18mu\hbox{(}{\rm mod}\,\,#1\hbox{)}}
\let\implies=\Longrightarrow
\def\?{\hbox{!`}} % subfactorial
\def\hyp{\mathop{F{}}\nolimits\hyper}
@@ -770,14 +772,14 @@
\def\hyper#1#2#3{\mathchoice{\tightplus
\hbox{$\displaystyle\biggl({#1\atop#2}\Big\vert\,{#3}\!\biggr)$}}%
{\bigl({#1\atop#2}\vert\mskip2mu#3\bigr)}%
- {}{}} % used only in D and T styles
+ {}{}} % used only in D and T styles
%\def\hypk_#1{\mathop{F{}}_{#1}\nolimits\hyper} % confl with mFn convention
\def\hypk_#1#2#3#4{\mathop{F{}}\mathchoice{\tightplus
\hbox{$\displaystyle\biggl({#2\atop#3}\Big\vert\,{#4}\!\biggr)$}%
\lower\fontdimen11\mathsym\hbox{$\scriptstyle\!#1$}}%
{\bigl({#2\atop#3}\vert\mskip2mu#4\bigr)\lower\fontdimen12\mathsym
\hbox{$\scriptstyle\!#1$}}%
- {}{}} % used only in D and T styles
+ {}{}} % used only in D and T styles
\def\double(#1\choose#2){\mathchoice{\biggl(\!\!{#1\choose#2}\!\!\biggr)}
{\bigl(\!{#1\choose#2}\!\bigr)}{}{}} % only D and T styles
\def\hypstrut{\vphantom{_1\_^k}} % if there's another denominator with \_^k
@@ -853,9 +855,9 @@
\hyphenation{logical Mac-Mahon hyper-geo-metric hyper-geo-met-rics Ber-noulli}
-\preprintfalse % WE ARE MAKING THE REAL BOOK!
-\inxmodetrue % WE ARE PREPARING A ROUGH INDEX
-\showmissestrue % THE REFERENCES SHOULD ALL BE READY NOW
+\preprintfalse % WE ARE MAKING THE REAL BOOK!
+\inxmodetrue % WE ARE PREPARING A ROUGH INDEX
+\showmissestrue % THE REFERENCES SHOULD ALL BE READY NOW
\ifinxmode\immediate\openout\inx=\jobname.inx \fi % file for index reminders
\ifinxmode\immediate\openout\bnx=\jobname.bnx \fi % file for bib reminders
@@ -883,7 +885,8 @@
\message{OK, I'm making final copy with trim marks!}
\hoffset=-.5in
\getnxtpg % this should ensure eof on the \pages file
-\else\message{OK, I'll ship only the requested pages!}\fi\fi
+\else\message{OK, I'll ship only the requested pages!}
+ \hoffset=-.5in\fi\fi
\def\shipout{\ifeof\pages\let\next=\Shipout
\else\ifnum\pageno=\nxtpg\getnxtpg\let\next=\Shipout
\else\let\next=\Tosspage\fi\fi \next}
diff --git a/systems/knuth/local/lib/letter.tex b/systems/knuth/local/lib/letter.tex
deleted file mode 100644
index efa2bf02fd..0000000000
--- a/systems/knuth/local/lib/letter.tex
+++ /dev/null
@@ -1,119 +0,0 @@
-% This macro file is for business letters
-
-\def\today{\ifcase\month\or
- January\or February\or March\or April\or May\or June\or
- July\or August\or September\or October\or November\or December\fi
- \space\number\day, \number\year}
-\def\narrower{\advance\leftskip by 20pt \advance\rightskip by 20pt }
-
-\raggedbottom
-\interlinepenalty=1000
-\hsize=6.25truein \voffset=24pt \advance\vsize by-\voffset
-\parindent=0pt \parskip=0pt
-\nopagenumbers
-\headline={\ifnum\pageno>1
- \tenrm To \addressee\hfil\today\hfil Page \folio
- \else\hfil\fi}
-
-\def\beginlinemode{\endmode
- \begingroup\obeylines\def\endmode{\par\endgroup}}
-\def\beginparmode{\endmode
- \begingroup\parskip=\medskipamount \def\endmode{\par\endgroup}}
-\let\endmode=\par
-\def\endletter{\endmode\vfill\supereject \pageno=1 }
-
-\newdimen\longindentation \longindentation=4truein
-\newbox\theaddress
-\def\address{\beginlinemode\getaddress}
-{\obeylines\gdef\getaddress#1
- #2
- {\gdef\addressee{#2\unskip}%
- \global\setbox\theaddress=\vbox\bgroup\raggedright%
- \hsize=\longindentation \everypar{\hangindent2em}#2
- \def\endmode{\egroup\endgroup \copy\theaddress \bigskip}}}
-
-\def\body{\beginparmode}
-\def\closing{\beginlinemode\getclosing}
-{\obeylines\gdef\getclosing #1
- #2
- {\nobreak\bigskip \leftskip=\longindentation #2
- \nobreak\bigskip\bigskip\bigskip % space for signature
- \def
- {\endgraf\nobreak}}}
-\def\annotations{\beginlinemode\def\par{\endgraf\nobreak}\obeylines\par}
-\def\ps{\beginparmode\nobreak
- \interlinepenalty5000\def\par{\endgraf\penalty5000}}
-\def\cc{\beginparmode\nobreak
- \interlinepenalty5000\def\par{\endgraf\penalty5000}}
-
-\def\up#1{\leavevmode \raise.16ex\hbox{#1}}
-\font\smallheadfont=cmr8 at 8truept
-\font\largeheadfont=cmbx10 at 14.4truept
-\font\logofont=stan70 at 70truept
-\def\stanfordseal{\vbox{\kern-3truept\hbox{\logofont A}\kern-3truept}}
-
-\def\csdreturn{Computer Science Department\par \stanfordreturn}
-\def\stanfordreturn{Stanford University\par
- Stanford, CA 94305\kern.5pt-9045 USA\par}
-\def\letterhead{\pageno=1 \univletterhead
- {\leftskip=\longindentation
- {\baselineskip9truept\smallheadfont\sendingaddress}
- \bigskip\bigskip\rm\today\bigskip}}
-\def\specrule#1{\nointerlineskip
- \line{\hbox to 60truept{\hrulefill
- \hphantom{\stanfordseal\kern-#1truept}%
- \hrulefill}\hrulefill}\nointerlineskip}
-\def\univletterhead{\vglue-34pt
- \specrule{11}\vskip8truept
- \hbox{\hbox to\longindentation{\smash{\hbox to60truept{\hfil\kern2.5truept
- \lower10truept\stanfordseal\hfil}}%
- \largeheadfont STANFORD UNIVERSITY\hfil}%
- \smallheadfont STANFORD, CALIFORNIA 94305\kern.5pt-9045}
- \vskip6truept\specrule{17}\vskip13truept }
-
-\def\deklet{
- \def\sendingaddress{DONALD E. KNUTH\par
- Professor Emeritus of The Art of\par
- \qquad Computer Programming\par
- Department of Computer Science\par
- Telephone \up[650\up]\thinspace 723-4367\par}
- \def\returnaddress{Prof.~D. E. Knuth\par \csdreturn}
- \letterhead}
-
-\def\memoto{\beginlinemode\parindent=60truept
- \everypar{\hangindent70truept}\startmemo}
-\def\bigmemoto{\beginlinemode\parindent=60pt % use this for magstep>1!
- \everypar{\hangindent70pt}\startmemo}
-\def\textin#1{\noindent\hbox to\parindent{#1\hss}\ignorespaces}
-{\obeylines\gdef\startmemo #1
- {\gdef\addressee{#1}%
- \global\pageno=1 \vglue-34pt\specrule{11}\vskip8truept
- \leftline{\smash{\hbox to60truept{\hfil\kern2.5truept
- \lower10truept\stanfordseal\hfil}}%
- \largeheadfont Stanford Computer Science Department %
- \rm\today}%
- \vskip6truept\specrule{20}\bigskip\bigskip\bigskip%
- \textin{Memo to:}#1
- \def\endmode{\par\endgroup\bigskip}}
- \gdef\from #1
- {\smallskip\textin{From:}#1
- }
- \gdef\subject #1
- {\smallskip\textin{Subject:}#1
- }
-}
-
-\def\makelabel{\endletter\hbox{\vrule
- \vbox{\hrule \kern6truept
- \hbox{\kern6truept\stanfordseal\kern3pt
- \vbox{\smallheadfont\baselineskip9truept\hsize=2truein\returnaddress}
- \kern6truept}\kern6truept\hrule}\vrule}
- \kern.1truein
- \hbox{\vrule
- \vbox{\hrule \kern12truept
- \hbox{\kern12truept\copy\theaddress
- \kern12truept}\kern12truept\hrule}\vrule}
- \pageno=0\vfill\eject}
-
-\def\frac#1/#2{\leavemode\kern.1em\raise.5ex\hbox{\the\scriptfont0
- #1}\kern-.1em/\kern-.15em\lower.25ex\hbox{\the\scriptfont0 #2}}
diff --git a/systems/knuth/local/lib/letterformat.tex b/systems/knuth/local/lib/letterformat.tex
new file mode 100644
index 0000000000..bc2144a3c1
--- /dev/null
+++ b/systems/knuth/local/lib/letterformat.tex
@@ -0,0 +1,85 @@
+% This macro file is for business letters
+
+\def\today{\ifcase\month\or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or December\fi
+ \space\number\day, \number\year}
+
+\raggedbottom
+\interlinepenalty=1000
+\hsize=6.25truein
+\voffset=24pt
+\advance\vsize by-\voffset
+\parindent=0pt
+\parskip=0pt
+\nopagenumbers
+\headline={\ifnum\pageno>1
+ \tenrm To \addressee\hfil\today\hfil Page \folio
+ \else\hfil\fi}
+
+\def\beginlinemode{\endmode
+ \begingroup\obeylines\def\endmode{\par\endgroup}}
+\def\beginparmode{\endmode
+ \begingroup\parskip=\medskipamount \def\endmode{\par\endgroup}}
+\let\endmode=\par
+\def\endletter{\endmode\vfill\supereject}
+
+\newdimen\longindentation \longindentation=4truein
+\newbox\theaddress
+\def\address{\beginlinemode\getaddress}
+{\obeylines\gdef\getaddress #1
+ #2
+ {#1\gdef\addressee{#2}%
+ \global\setbox\theaddress=\vbox\bgroup\raggedright%
+ \hsize=\longindentation \everypar{\hangindent2em}#2
+ \def\endmode{\egroup\endgroup \copy\theaddress \bigskip}}}
+
+\def\body{\beginparmode}
+\def\closing{\beginlinemode\getclosing}
+{\obeylines\gdef\getclosing #1
+ #2
+ {#1\nobreak\bigskip \leftskip=\longindentation #2
+ \nobreak\bigskip\bigskip\bigskip % space for signature
+ \def
+ {\endgraf\nobreak}}}
+\def\annotations{\beginlinemode\def\par{\endgraf\nobreak}\obeylines\par}
+\def\ps{\beginparmode\nobreak
+ \interlinepenalty5000\def\par{\endgraf\penalty5000 }}
+
+\def\up#1{\leavevmode \raise.16ex\hbox{#1}}
+\font\smallheadfont=cmr8 at 8truept
+\font\largeheadfont=cmdunh10 at 14.4truept
+\font\logofont=manfnt at 14.4truept
+
+\def\rjdletterhead{
+ \def\sendingaddress{R. J. DROFNATS, F.T.U.G.\par
+ PROFESSOR OF FARM ECOLOGY\par
+ TEX.RJD @ SU-SCORE.ARPA\par
+ \up[415\up]\thinspace 497-4975\par}
+ \def\returnaddress{R. J. Drofnats, Dept.~of Farm Ecology\par
+ The University of St.~Anford\par
+ P. O. Box 1009, Haga Alto, CA 94321 USA}
+ \letterhead}
+
+\def\letterhead{\pageno=1 \def\addressee{} \univletterhead
+ {\leftskip=\longindentation
+ {\baselineskip9truept\smallheadfont\sendingaddress}
+ \bigskip\bigskip\rm\today\bigskip}}
+
+\def\univletterhead{\vglue-\voffset
+ \hbox{\hbox to\longindentation{\raise4truemm\hbox{\logofont
+ \kern2truept X\kern-1.667truept
+ \lower2truept\hbox{X}\kern-1.667truept X}\hfil
+ \largeheadfont The University of St.~Anford\hfil}%
+ \kern-\longindentation
+ \vbox{\smallheadfont\baselineskip9truept
+ \leftskip=\longindentation BOX 1009\par HAGA ALTO, CA 94321}}
+ \vskip2truept\hrule\vskip4truept }
+
+\def\makelabel{\endletter\hbox{\vrule
+ \vbox{\hrule \kern6truept
+ \hbox{\kern6truept\vbox to 2truein{\hsize=\longindentation
+ \smallheadfont\baselineskip9truept\returnaddress
+ \vfill\moveright 2truein\copy\theaddress\vfill}%
+ \kern6truept}\kern6truept\hrule}\vrule}
+ \pageno=0\vfill\eject}
diff --git a/systems/knuth/local/lib/list-latin.tex b/systems/knuth/local/lib/list-latin.tex
index 71d5bb6d9a..09e27dd479 100644
--- a/systems/knuth/local/lib/list-latin.tex
+++ b/systems/knuth/local/lib/list-latin.tex
@@ -1,4 +1,3 @@
-% This program by D. E. Knuth is not copyrighted and can be used freely.
% Makes a listing of one or more files
% Extended to allow the Latin-1 accented characters in UTF-8 encoding
% Typical usage:
@@ -63,32 +62,3 @@
% at present, it's indistinguishable from newline (^^J).
% You can get up to 103 characters on a line without an overfull box.
-
-% Further notes from Don, January 2017:
-%
-% Maybe I'm the only person left who still uses plain TeX in a UTF-8 world.
-%
-% But for what it's worth, I'm appending a little file that I prepared today,
-% since it turned out to be useful in a project of interest to me.
-%
-% Namely, I've got a program that takes an XML encoding of organ-pipe
-% settings, used by performers when they change the stops during a
-% performance, and translates it into a human-readable form.
-% I mean, the output says "when you reach combination nunber 0013,
-% the following ranks of pipes are set to play".
-%
-% The names of those ranks of pipes often contain accented characters,
-% as well as things like the German \ss. In order to use such texts on the Web,
-% I have them in UTF-8 code. But to make a verbatim hardcopy listing using
-% nice typewriter-style fonts, I wanted a program like "list.tex", which
-% I've been using to print text files for more than 25 years.
-%
-% Fortunately, the accented characters all turn out to be two-character
-% sequences in UTF-8, where the first character is always '303. So I
-% can simply make that character active, and it can then change the
-% following character appropriately.
-%
-% Therefore I added a few lines to "list.tex", resulting in "list-latin.tex".
-% And it works! Hence it might be a useful addition to the CTAN archives.
-%
-% Yours truly, Don
diff --git a/systems/knuth/local/lib/llist-latin.tex b/systems/knuth/local/lib/llist-latin.tex
new file mode 100644
index 0000000000..cbc6140850
--- /dev/null
+++ b/systems/knuth/local/lib/llist-latin.tex
@@ -0,0 +1,84 @@
+% Makes a landscape listing of one or more files
+% Extended to allow the Latin-1 accented characters in UTF-8 encoding
+% Typical usage:
+% tex llist-latin *.txt \\end
+
+\def\grabfile#1 {\setbox0=\lastbox\endgraf\doit{#1}}
+\everypar{\grabfile}
+
+\font\filenamefont= cmtt8 scaled\magstep3
+\font\headlinefont= cmr8
+\font\listingfont= cmtex8
+\font\ttfont= cmtt8
+\font\syttfont= cmsytt10 at 8pt
+\font\eoffont= cmti8
+
+\def\today{\ifcase\month\or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or December\fi
+ \space\number\day, \number\year}
+\newcount\m \newcount\n
+\n=\time \divide\n 60 \m=-\n \multiply\m 60 \advance\m \time
+\def\hours{\twodigits\n\twodigits\m}
+\def\twodigits#1{\ifnum #1<10 0\fi \number#1}
+
+\newlinechar=`@
+\message{@\today\space at \hours}
+
+\baselineskip=9pt
+\medskipamount=4pt minus 1pt
+\raggedbottom
+\nopagenumbers
+
+\newcount\n
+\catcode`\^^c3=\active
+\def\missing{{\syttfont\char15}}
+\def^^c3#1{\n=`#1\advance\n by-128
+ {\ttfont\ifcase\n
+ \`A\or\'A\or\^A\or\~A\or\"A\or\AA\or\AE\or\c C\or
+ \`E\or\'E\or\^E\or\"E\or\`I\or\'I\or\^I\or\"I\or
+ \missing\or\~N\or\`O\or\'O\or\^O\or\~O\or\"O\or{\syttfont\char2}\or
+ \O\or\`U\or\'U\or\^U\or\"U\or\'Y\or\missing\or\ss\or
+ \`a\or\'a\or\^a\or\~a\or\"a\or\aa\or\ae\or\c c\or
+ \`e\or\'e\or\^e\or\"e\or\`\i\or\'\i\or\^\i\or\"\i\or
+ \missing\or\~n\or\`o\or\'o\or\^o\or\~o\or\"o\or{\syttfont\char4}\or
+ \o\or\`u\or\'u\or\^u\or\"u\or\'y\or\missing\or\"y\fi}}
+
+\chardef\other=12
+\def\doit#1{\message{@Listing #1@}
+ \begingroup \everypar{} \frenchspacing
+ \headline{\ifright \headlinefont \hfill Page \folio
+ \else\filenamefont#1\quad\headlinefont \today\ at \hours\hss \fi}
+ \def\do##1{\catcode`##1=\other}\dospecials
+ \catcode127=\other \catcode9=\other \catcode12=\other
+ \parindent 0pt \parfillskip=0pt plus 1fil minus .8in
+ \everypar{\hangindent 1in} \rightskip=0pt plus 2in
+ \def\par{\ifvmode\penalty-50\medskip\else\endgraf\fi}
+ \listingfont \obeylines \obeyspaces \global\pageno=1
+ \input #1 {\eoffont(end of\/ file)}\endgraf\vfill\eject
+ \ifright\null\vfill\eject\fi\endgroup}
+{\obeyspaces\global\let =\ }
+\catcode`\_=\other % allow _ in file names
+
+\hsize=4.6truein
+\vsize=7truein
+\hoffset=-.5truein
+\voffset=-.2truein
+\newif\ifright
+\newbox\lefthalf
+\output{\ifright
+ \shipout\hbox{\hbox to5.5in{\box\lefthalf\hss}%
+ \vbox{\makeheadline\pagebody\makefootline}}
+ \advancepageno\global\rightfalse
+ \else\global\setbox\lefthalf\vbox{\makeheadline\pagebody\makefootline}
+ \global\righttrue\fi}
+
+\special{landscape}
+
+% A tab (^^I) prints as lowercase gamma.
+% Character ^^M could be made visible, with a bit of work;
+% at present, it's indistinguishable from newline (^^J).
+
+% You can get up to 91 characters on a line without an overfull box.
+% (But lines with more than 84 characters will be clipped, if they
+% appear on a righthand halfpage.)
diff --git a/systems/knuth/local/lib/llist.tex b/systems/knuth/local/lib/llist.tex
index f107169e24..9674f61803 100644
--- a/systems/knuth/local/lib/llist.tex
+++ b/systems/knuth/local/lib/llist.tex
@@ -31,7 +31,7 @@
\def\doit#1{\message{@Listing #1@}
\begingroup \everypar{} \frenchspacing
\headline{\ifright \headlinefont \hfill Page \folio
- \else\filenamefont#1\quad\headlinefont \today\ at \hours\hfill \fi}
+ \else\filenamefont#1\quad\headlinefont \today\ at \hours\hss \fi}
\def\do##1{\catcode`##1=\other}\dospecials
\catcode127=\other \catcode9=\other \catcode12=\other
\parindent 0pt \parfillskip=0pt plus 1fil minus .8in
diff --git a/systems/knuth/local/lib/twimac.tex b/systems/knuth/local/lib/twimac.tex
index 99905f168c..ce9d983350 100644
--- a/systems/knuth/local/lib/twimac.tex
+++ b/systems/knuth/local/lib/twimac.tex
@@ -238,10 +238,11 @@
\begingroup\catcode`\_=\active \globaldefs=1
\def\flushout{\ifvoid\partialpage\else
\setbox0=\vsplit\partialpage to 44pc
- \shipout\vbox{
+ \setbox2=\vbox{
\vbox to 3pc{
\hbox to 35pc{\vbox to10pt{}\nineit\rhead\hfil\eightrm\folio}\vfill}
- \nointerlineskip\box0}
+ \nointerlineskip\box0}%
+ \shipout\box2
\global\advance\pageno 1
\let\=\makeref
\ifsorted \let\readin=\readln \readrefs
@@ -252,13 +253,12 @@
\hyphenpenalty 10000 \exhyphenpenalty 10000
\noindent\vbox to1pt{}\par % 1pt = \topskip - \ninept
\readin}
- \shipout\vbox to47pc{
+ \setbox2=\vbox to47pc{
\vbox to 3pc{
\hbox to 35pc{\vbox to10pt{}\eightrm\folio\hfil\nineit\rrhead\/}\vfill}
\unvbox\partialpage
\vfill
-% \ifdim\ht0>1pt \kern8pt\hrule \hbox{%
- \ifdim\ht0>1pt \kern11pt\hrule \hbox{% % changed Oct 87 by DEK!
+ \ifdim\ht0>1pt \kern11pt\hrule \hbox{% changed 8pt to 11pt Oct 87 by DEK!
\nsize=\ht0 \advance\nsize-\topskip
\divide\nsize by 3 \divide\nsize by\ninept
\multiply\nsize by\ninept \advance\nsize\topskip
@@ -267,7 +267,8 @@
\divide\msize by 2 \divide\msize by\ninept
\multiply\msize by\ninept \advance\msize\topskip
\vbox to\nsize{\vsplit0 to\msize\vss}\kern1pc
- \vbox to\nsize{\box0\vss}} \fi}
+ \vbox to\nsize{\box0\vss}} \fi}%
+ \shipout\box2
\global\advance\pageno 1 \global\let\rhead=\rrhead\fi
{\globaldefs=1
\nn=199 \loop \ifnum\nn<221 \toks\nn={} \count\nn=0 \advance\nn 1 \repeat
@@ -338,10 +339,11 @@
\def\lheader{\vbox to10pt{}\nineit\rhead\hfil\eightrm\folio}
\def\rheader{\vbox to10pt{}\eightrm\folio\hfil\nineit\rhead\/}
\def\page{\box255 }
-\def\normaloutput#1{\shipout\vbox{
+\def\normaloutput#1{\setbox2=\vbox{
\vbox to 3pc{
\hbox to 35pc{\ifodd\pageno\rheader\else\lheader\fi}\vfill}
- \nointerlineskip#1}
+ \nointerlineskip#1}%
+ \shipout\box2
\global\advance\pageno 1 }
\newbox\sbox % saved box preceding the index