summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/plain/base/gkpmac.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-04-23 23:13:33 +0000
committerKarl Berry <karl@freefriends.org>2008-04-23 23:13:33 +0000
commit1b5a2b603c2cf0f0bb4876a2769438f6f31a8fff (patch)
tree8c5cf53f5fb82d7c360898eae35a16642a786ac8 /Master/texmf-dist/tex/plain/base/gkpmac.tex
parentfc7a668ac46e1b0e8c8be4fb01a809f14e11d50a (diff)
remaining knuth 2008 updates
git-svn-id: svn://tug.org/texlive/trunk@7621 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/plain/base/gkpmac.tex')
-rw-r--r--Master/texmf-dist/tex/plain/base/gkpmac.tex43
1 files changed, 37 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/plain/base/gkpmac.tex b/Master/texmf-dist/tex/plain/base/gkpmac.tex
index cdcd7b9c087..1ae0f1a7a68 100644
--- a/Master/texmf-dist/tex/plain/base/gkpmac.tex
+++ b/Master/texmf-dist/tex/plain/base/gkpmac.tex
@@ -10,6 +10,7 @@
\font\textbf=cmbx10 % bold
\font\textcsc=cccsc10 % caps and small caps
\font\oldsty=ccmi10 % equation numbers
+\font\twelvett=cmtt12
% Fonts for regular math
% I'm setting \fontdimen2 to zero because AMS forgot to do it;
@@ -405,15 +406,37 @@
\iftitle\hfil\copyrite\else\runhead\uppercase\expandafter{\chaptitle}\hfil\fi}}
\def\rightheadline{\hbox to35pc{\iftitle\copyrite\fi\hfil
\vbox to 10pt{}% strut to position the baseline
- \runhead\uppercase\expandafter{\topmark}%
+ \iftitle\else\runhead\uppercase\expandafter{\topmark}\fi
\rlap{\hfil\iftitle\rightcorner\else\foliofont\folio\fi\kern-2pc}}}
-\def\leftcorner{\vrule\vbox to\folioht{\hrule width9pt\vfil}}
-\def\rightcorner{\vbox to\folioht{\hrule width9pt\vfil}\vrule}
+\def\leftcorner{\iffinal\else\vrule\vbox to\folioht{\hrule width9pt\vfil}\fi}
+\def\rightcorner{\iffinal\else\vbox to\folioht{\hrule width9pt\vfil}\vrule\fi}
\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\outermargin \outermargin=23mm
+\newdimen\topmargin \topmargin=10mm % plus height of the headline box
+\newbox\htrim \newbox\vtrim \newbox\trimmarks
+\setbox\htrim=\hbox to\htrimsize{\kern-.65in
+ \vrule height .2pt depth .2pt width .4in\hfil\vrule width.4in\kern-.65in}
+ \wd\htrim=0pt
+\setbox\vtrim=\vbox to\vtrimsize{\kern-.65in
+ \moveleft.2pt\hbox{\vrule height .4in}\vfil
+ \moveleft.2pt\hbox{\vrule height .4in}\kern-.65in}
+ \wd\vtrim=0pt
+\setbox\trimmarks=\hbox to0pt{\raise\vtrimsize\copy\htrim \copy\htrim
+ \copy\vtrim \kern\htrimsize \copy\vtrim\hss}
+ \ht\trimmarks=0pt \dp\trimmarks=0pt
+
+\newif\iffinal % are we making the final copy? (pages.tex says "999")
\def\onepageout#1{\escapechar=-1 % for writing \tabrefs
- \shipout\vbox to\totheight{ % here we define one page of output
+ \shipout % here we define one page of output
+ \iffinal % add the trim marks
+ \hbox to\htrimsize{\copy\trimmarks
+ \ifodd\pageno\hss\else \hskip\outermargin\fi
+ \vbox to\vtrimsize{\kern\topmargin\fi
+ \vbox to\totheight{
\offinterlineskip % butt the boxes together
\vbox to 2pc{ % this part goes on top of the regular pages
\ifodd\pageno \rightheadline\else\leftheadline\fi
@@ -424,6 +447,9 @@
\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
+ \rlap{\smash{\lower30pt\hbox to.35in{\hss\twelvett\number\pageno}}}\fi
}
\advancepageno}
@@ -851,8 +877,13 @@
{\endlinechar=-1\read\pages to\next
\ifx\next\empty % in this case we should have eof now
\else\global\nxtpg=\next\fi}\fi}
-\ifeof\pages\else\message{OK, I'll ship only the requested pages!}
- \getnxtpg\fi
+\ifeof\pages\finalfalse\else\finaltrue
+ \getnxtpg
+\ifnum\nxtpg=999
+ \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
\def\shipout{\ifeof\pages\let\next=\Shipout
\else\ifnum\pageno=\nxtpg\getnxtpg\let\next=\Shipout
\else\let\next=\Tosspage\fi\fi \next}