diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex209/contrib/pageframe |
Initial commit
Diffstat (limited to 'macros/latex209/contrib/pageframe')
-rw-r--r-- | macros/latex209/contrib/pageframe/README | 58 | ||||
-rw-r--r-- | macros/latex209/contrib/pageframe/pagefram.sty | 248 | ||||
l--------- | macros/latex209/contrib/pageframe/pageframe.sty | 1 | ||||
-rw-r--r-- | macros/latex209/contrib/pageframe/pgframed.tex | 686 | ||||
-rw-r--r-- | macros/latex209/contrib/pageframe/pgframet.tex | 43 |
5 files changed, 1036 insertions, 0 deletions
diff --git a/macros/latex209/contrib/pageframe/README b/macros/latex209/contrib/pageframe/README new file mode 100644 index 0000000000..f97a00efda --- /dev/null +++ b/macros/latex209/contrib/pageframe/README @@ -0,0 +1,58 @@ + + pageframe.sty + pgframedoc.tex + pgframetest.tex + +"pageframe.sty" is a LaTeX style file primarily intended +to assist in preparing books, although it is also useful +when other types of documents are being designed. Using +the "pageframe" option causes LaTeX to put corner marks +and tag lines on the pages of the document, and optionally +allows the user to include a graph-paper-like grid over +the text area (for measuring indentations, space around +heads or figures, etc.) and/or rules that outline the +text area, header, and footer (so you can see the effects +of such parameters as \textheight, \evensidemargin, +\topsep, \footskip, etc.) and/or rules that outline the +trimmed size of the page (assuming that the ultimate size +of the document is smaller than the size of the paper on +which it is being printed). + +"pageframe.sty" has been privately tested by me and a few +friends who are doing book production work, so I think it's +free of major bugs, but comments and suggestions for enhancements +are very welcome. + +"pgframedoc.tex" is a (lengthy) documentation file (for LaTeX) +that explains and illustrates the features provided by +"pageframe.sty" (and incidentally explains a few quirks and +even bugs of LaTeX that affect the use of "pageframe"). +"pgframetest.tex" is a short document that illustrates +the use of "pageframe" without explaining anything. + +NOTE ABOUT REDISTRIBUTION (ARCHIVE MAINTAINERS TAKE NOTE!) +I put a lot of work into the documentation file (with help +from beta testers). It is my wish that the style file +"pageframe.sty" NEVER EVER be distributed without the +documentation file "pgframedoc.tex". If you want to place +these files in an archive, you may re-package the Unix-oriented +compressed tar archive into ".arc" or ".zoo" or ".lzh" or ".shar" +or other format, but PLEASE DO NOT place the style file itself +(separately from the doc file) into your archive. Please +DO NOT EVEN MAKE IT POSSIBLE for a user of your archive +to retrieve the style file without the documentation file. +Of course, this request also applies to "private" transfers: +please NEVER EVER give anyone the style file without the +documentation. + +[ Yes, I know about "doc.sty", but although I have successfully +read documentation that was prepared with it, and extracted +style files that are in that format, I haven't been able to +find the file "doc.doc" that explains how to *create* a self- +documenting style file. I don't have Volume 10 of TUGboat (which +I believe included an article about it) -- I wasn't a TUG member +back then -- and I didn't feel like deducing the usage of +the "doc.sty" macros from other peoples' documentation files. ] + +--Cameron Smith + cameron@symcom.math.uiuc.edu diff --git a/macros/latex209/contrib/pageframe/pagefram.sty b/macros/latex209/contrib/pageframe/pagefram.sty new file mode 100644 index 0000000000..0ca5749fa1 --- /dev/null +++ b/macros/latex209/contrib/pageframe/pagefram.sty @@ -0,0 +1,248 @@ +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% pageframe.sty by Cameron Smith +%% 18 Sept 1990, 16 Oct 1990, 21 Nov 1990, 14 Nov 1991 +%% +%% By default, draws a frame around the text area to represent +%% the edge of the paper -- useful when pages for a book of size +%% 7x9 inches (for example) is being proofed on 8 1/2 x 11 inch +%% paper. If \pageframefalse is executed, the part of the frame +%% beside the text is removed, leaving only the corner marks +%% to use for checking registration and for cropping. +%% The full frame can be restored by executing \pageframetrue. +%% +%% This shows the results of +%% +%% \pageframetrue and \pageframefalse +%% +%% _|__________|_ _| |_ +%% | | +%% | | +%% | | +%% | | +%% | | +%% | | +%% _|__________|_ _ _ +%% | | | | +%% +%% +%% This style option also prints (outside the page area) a timestamp, +%% a job ID, and the page number and a sequence number on each page. +%% The sequence number advances throughout the document, so even if +%% there is a page (i) and several pages 1, only the first page +%% will have sequence number 1. +%% +%% An oversight in the original version sometimes caused the tag line +%% to be printed in an unusual font (if that was the last-used font +%% on the preceding page). The current version explicitly sets the +%% font for the tag line so that this won't happen. The default is +%% to use cmr10, since it's highly unlikely that there are any TeX +%% sites that don't have this font available, but the \pffont macro +%% is provided in case another font is desired. +%% +%% Two more features have been added: an "inner skeleton", consisting +%% of rules that demarcate the header, footer, and text area, and a +%% "text grid" that can be placed inside the text area. Use +%% "\innerskeltrue" or "\innerskelfalse" to control the skeleton +%% and "\textgridtrue" or "\textgridfalse" to control the text grid. +%% Use (for example) "\gridsize{10pt}{12pt}" to make a grid whose +%% squares have width 10pt and height 12pt. +%% +%% To use this style option, include pageframe as an optional argument +%% in the \documentstyle command, e.g. +%% +%% \documentstyle[pageframe]{book} +%% +%% Also you must tell LaTeX the height of the paper you are using +%% (it can deduce the width for itself). You do this by including +%% a declaration such as +%% \paperheight{9in} +%% +%% in the preamble of your document. This *must* appear before +%% the first page of output, because the new output routine +%% uses this value. (If you forget to specify it, then two +%% things will happen: the vertical rules at the sides of the +%% text will disappear, because LaTeX thinks they have height 0pt, +%% and the rule that represents the bottom of the paper will be +%% flush against the bottom of the footer.) +%% +%% Since this style file modifies (a part of) LaTeX's output routine, +%% it is exceedingly unlikely to be compatible with any other style +%% option that also modifies the output routine. +%% +%% Please direct comments and bug reports by electronic mail +%% to CAMERON@MIDD.BITNET or cameron@midd.cs.middlebury.edu +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% This is the timestamp +%% +\@tempcnta\time\@tempcntb\@tempcnta +\divide\@tempcntb by 60\multiply\@tempcntb by 60\advance\@tempcnta-\@tempcntb +\divide\@tempcntb by 60 +\edef\@@@timestamp{\vrule height.4in depth .3in width 0pt% + \hskip.5in\today\space\space + \ifnum\@tempcntb<10 0\fi + \number\@tempcntb:\ifnum\@tempcnta<10 0\fi\number\@tempcnta + \space\space\space\space\space\space\jobname + \space\space\space\space\space\space +} +%% +%% \pffont lets us specify the font to use for the tag line +%% By default we use whatever font is current when this file is +%% being loaded. This will normally be cmr10; in any case we're +%% selecting a font which is (a) certainly available on the system +%% were running on and (b) probably suitable for this purpose +%% (normal-sized roman text). +%% +\def\pffont#1{\global\font\@@@pffont=#1\relax} +\def\@@@pffont{\global\let\@@@pffont} +\expandafter\@@@pffont\the\font +%% +\newcount\@@@sheetcount +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% This is the code that makes the "inner skeleton". +%% +\newif\ifinnerskel +\newif\iftextgrid +\textgridtrue +\newdimen\@@@gridwd\newdimen\@@@gridht +\def\gridsize#1#2{\global\@@@gridwd#1\global\@@@gridht#2} +\@@@gridwd 10pt \@@@gridht 10pt +%% +\def\@@@innerskel{\vbox to 0pt{% +\vskip \topmargin +\vbox to 0pt{\vss\hrule width\textwidth}% +\vskip \headheight +\vbox to 0pt{\vss\hrule width\textwidth}% +\vskip \headsep +\vbox to 0pt{\vss\hrule width\textwidth}% +\iftextgrid +\vbox to 0pt{\vbox to \textheight{% +\leaders\vbox to \@@@gridht{\vss\hrule width\textwidth}\vfil +}\vss}% +\fi +\hbox to \textwidth{\llap{\vrule height\textheight}% +\iftextgrid\leaders\hbox to\@@@gridwd{\hfil\vrule height\textheight}\fi\hfil +\vrule height\textheight}% +\vbox to 0pt{\vss\hrule width\textwidth}% +\vskip \footskip +\vbox to 0pt{\vss\hrule width\textwidth}% +\vskip -\footheight +\vbox to 0pt{\vss\hrule width\textwidth}% +\vss +}} +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% The paper width can be deduced from the text width and margins, +%% but the paper height must be specified. +%% +\newdimen\@@@pageheight +\def\paperheight#1{\global\@@@pageheight#1} +\newdimen\@@@pagewidth +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% The part of the output routine that puts the frame on the +%% page to represent the edge of the paper is surrounded by +%% \ifpageframe...\fi so that it can be suppressed. +%% +\newif\ifpageframe +\pageframetrue +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% \@@@cropmark should be followed by two letters, the first of which +%% is t or b (for top or bottom) and the second l or r (left or right). +%% It makes a box of height, width, and depth 0pt, but with a +%% crop mark extending above or below and left or right of the base point. +%% +%% The arms of the crop mark do not quite meet, but are positioned +%% so that if they were extended to meet, the meeting point would be +%% the corner of the paper. This is to allow a little leeway for +%% positioning and cutting the paper. +%% +\def\@@@cropmark#1#2{% +\csname#2lap\endcsname{% +\vbox to 0pt{% +\if#1t\vss\else +\hbox to .5in{\if#2r\hfil\fi +\vrule width .45in height .4pt depth 0pt\if#2l\hfil\fi}% +\vglue.05in\fi% +\hbox to .5in{\if#2l\hfil\fi\vrule height .45in depth 0pt\if#2r\hfil\fi}% +\if#1b\vss\else +\vglue.05in% +\hbox to .5in{\if#2r\hfil\fi +\vrule width .45in height .4pt depth 0pt\if#2l\hfil\fi}% +\fi% +}}% +} +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +\let\@theothermargin\@themargin +%% +\def\@outputpage{\begingroup\catcode`\ =10 + \let\-\@dischyph \let\'\@acci \let\`\@accii \let\=\@acciii + \if@specialpage + \global\@specialpagefalse\@nameuse{ps@\@specialstyle}\fi + \if@twoside + \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot + \let\@themargin\oddsidemargin + \let\@theothermargin\evensidemargin + \else \let\@thehead\@evenhead + \let\@thefoot\@evenfoot \let\@themargin\evensidemargin + \let\@theothermargin\oddsidemargin + \fi\fi + \global\advance\@@@sheetcount by1% + \shipout + \vbox{\normalsize \baselineskip\z@ \lineskip\z@ + \let\par\@@par %% 15 Sep 87 + \vbox to 0pt{\vss + \hbox{\@@@pffont\@@@timestamp + Sheet number \number\@@@sheetcount + \space\space Page number \thepage + } + \hrule height 0pt depth 0pt + } + \@@@pagewidth\@themargin\advance\@@@pagewidth\textwidth + \advance\@@@pagewidth\@theothermargin + \hbox{\@@@cropmark tl\hskip\@@@pagewidth\@@@cropmark tr} + \ifpageframe\vbox to0pt{\vss\hrule width\@@@pagewidth}\fi + \hbox{% + \ifpageframe\llap{\vrule height0pt depth\@@@pageheight}\else + \vrule height0pt depth\@@@pageheight width0pt\fi + \hskip\@themargin + \vtop{\ifinnerskel\@@@innerskel\fi + \vskip \topmargin + \setbox\@tempboxa + \vbox to\headheight{\vfil \hbox to\textwidth + {\let\label\@gobble \let\index\@gobble + \@thehead}} %% 22 Feb 87 + \dp\@tempboxa\z@ + \box\@tempboxa + \vskip \headsep + \box\@outputbox + \baselineskip\footskip + \hbox to\textwidth{\let\label\@gobble + \let\index\@gobble %% 22 Feb 87 + \@thefoot}% + }% + \ifpageframe + \hskip\@theothermargin + \rlap{\vrule height0pt depth\@@@pageheight}\fi + } + \ifpageframe\vbox to0pt{\hrule width\@@@pagewidth\vss}\fi + \hbox{\@@@cropmark bl\hskip\@@@pagewidth\@@@cropmark br} + } + \global\@colht\textheight + \endgroup\stepcounter{page}\let\firstmark\botmark} +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% End of "pageframe.sty" +%% diff --git a/macros/latex209/contrib/pageframe/pageframe.sty b/macros/latex209/contrib/pageframe/pageframe.sty new file mode 120000 index 0000000000..d274c90fc8 --- /dev/null +++ b/macros/latex209/contrib/pageframe/pageframe.sty @@ -0,0 +1 @@ +pagefram.sty
\ No newline at end of file diff --git a/macros/latex209/contrib/pageframe/pgframed.tex b/macros/latex209/contrib/pageframe/pgframed.tex new file mode 100644 index 0000000000..eaf2ee86bd --- /dev/null +++ b/macros/latex209/contrib/pageframe/pgframed.tex @@ -0,0 +1,686 @@ +\documentstyle[pageframe]{book} +%%%%%%%%%% +%% +%% Parameters used by pageframe +%% +\paperheight{9.3in} +\footheight 10pt +%%%%%%%%%% +%% +%% Macros to make filler text +%% +\newcount\foo\def\testsen{\advance\foo by1% +This is filler sentence number \the\foo. }% +\def\testsenfive{\testsen\testsen\testsen\testsen\testsen}% +\newcount\bar\def\testpar{\advance\bar by1% +This is filler paragraph number \the\bar. +\testsenfive\testsenfive\testsenfive\par}% +\def\fourtestpars{\testpar\testpar\testpar\testpar} +%%%%%%%%%% +%% +%% The basic style we're using is "book" style, +%% but we re-define many parameters: +%% +%% white space between paragraphs +\parskip 12pt +%% handling of short text pages +\raggedbottom +%% numbering of sections +\def\thesection{\arabic{section}} +\setcounter{secnumdepth}{0} +%% left-hand running heads (usually set by \chapter, +%% but this document doesn't have any \chapter's) +\markboth{The {\tt pageframe} document style option}{} +%% right-hand running heads (set by \section; we omit +%% the \uppercase macro so the heads don't SCREAM at us) +\def\sectionmark#1{\markright{#1}} +%% margins +\evensidemargin 1in +\oddsidemargin .75in +\topmargin .5in +\headsep .2in +%% +\textwidth 4.65in +%% +\textheight=45\baselineskip +\advance\textheight by\topskip +%% space around list environments (including center) +\topsep 0pt +%% footnotes (use a dagger instead of a numeral) +%{\makeatletter +%\gdef\@makefnmark{\hbox{$^{\dag}$}} +%\long\gdef\@makefntext#1{\parindent 1em\noindent +% \hbox to 1.8em{\hss$^{\dag}$\ }#1} +%} +\def\thefootnote{\fnsymbol{footnote}} +%% +%% Thanks to anita@brahms.udel.edu (Anita Marie Hoover) +%% for this code, which causes footnotes always to appear at +%% the bottom of a page even if the page isn't full of text. +%% She posted the fix in comp.text.tex +%% (article <25024@brahms.udel.edu> on 14 Oct 91 at 14:26:22 GMT). +%% This modifies part of LaTeX's output routine; the original +%% lines are commented out. +%% +\makeatletter +\def\@makecol{\ifvoid\footins \setbox\@outputbox\box\@cclv + \else\setbox\@outputbox +% \vbox{\boxmaxdepth \maxdepth +% \unvbox\@cclv\vskip\skip\footins\footnoterule\unvbox\footins}\fi + \vbox to\@colht{\boxmaxdepth\maxdepth\unvbox\@cclv\vfill\relax + \vskip\skip\footins\footnoterule\unvbox\footins}\fi + \xdef\@freelist{\@freelist\@midlist}\gdef\@midlist{}\@combinefloats + \setbox\@outputbox\vbox to\@colht{\boxmaxdepth\maxdepth + \@texttop\dimen128=\dp\@outputbox\unvbox\@outputbox + \vskip-\dimen128\@textbottom}% + \global\maxdepth\@maxdepth} +\makeatother +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +\begin{document} +%% +\pageframefalse +%% +\thispagestyle{plain} +\begin{center} +{\LARGE\bf +The {\tt pageframe} document style option}\\[5pt] +{\large Cameron Smith}\\[5pt] +version current as of 2 December 1991 +\end{center} +%% +\section{Introduction} +The \verb"pageframe" document style option was written as an aid +for people who are using \LaTeX\ to make books. It assumes that +the pages generated by \LaTeX\ are printed on paper larger than the +ultimate trimmed and bound size of the leaves of the book +(for example, pages of a $7{\rm in}\times9{\rm in}$ book printed +on $8\frac12{\rm in}\times11{\rm in}$ paper). The \verb"pageframe" +style option provides the following services: +\begin{itemize} +\item Corner marks to serve as guides in trimming the page to final size +\item An identifying line of text (commonly called a tag line) + across the top of each printed page, + outside the final trim area, containing +\begin{itemize} +\item the name of the job that produced the page + (this is the name of the main input file), +\item the time and date when the job was run, +\item the folio (the number of the page in the document's + own numbering system---this number may be a roman numeral, + and it may not be unique within the document), and +\item the absolute sequence number of the sheet within the document + (this starts at number 1 and increases throughout the document) +\end{itemize} +\item A frame around the trim area of the page +\item Frames around the running head, text body, and footline +\item A grid (of user-specified dimensions) within the text body +\end{itemize} +The tag line and corner marks are always printed; the other +features may be turned on (separately) for draft or proof runs +but would be turned off when the final form of the document is +being generated. + +This document illustrates and explains the features that the +\verb"pageframe" style provides. The pages of the document are printed +with different combinations of the \verb"pageframe" option settings; +you may want to look at the \LaTeX\ source for the document +to see how these are specified. You will find +a summary of the \verb"pageframe" commands near the end +of this document. + +\pagebreak +\pageframetrue +%% +\section{The Page Frame} +The page frame is a rectangle that outlines the entire area of the +final trimmed page. (The edges of this rectangle therefore line up +with the lines that make up the corner marks.) +It's useful in drafts to allow the designer to see where +the design elements (folios, running heads and feet, +displays, text body, etc.) will fall in relation to the edges +of the printed page. The page you're now reading +has this frame. This feature is turned on +by default when the \verb"pageframe" style is used, but you can +turn it off and back on with the commands +\begin{center} +\begin{tabular}{l} +\verb"\pageframefalse"\\ +\verb"\pageframetrue" +\end{tabular} +\end{center} +(respectively). +The setting (false=off or true=on) that is in effect when a page +is actually emitted to the \verb"dvi" file (that is, when \LaTeX's +``output routine'' is invoked) is the one that is obeyed, so if you +change this setting partway through a document it may take effect +a page or so before or after you expected. (This happens because +\TeX\ is typically in the middle of page $n+1$ before it realizes +that it has accumulated enough material to fill page $n$.) + +%% +\pagebreak +%\pageframefalse +\innerskeltrue +\textgridfalse +%% +\section{The Inner Skeleton} +The \verb"pageframe" style also allows the designer to outline +the headline, footline, and text body rectangle of a page. +I call this the ``inner skeleton'' of the page (for want of a +better name), and you can turn it on or off with +\begin{center} +\begin{tabular}{l} +\verb"\innerskeltrue"\\ +\verb"\innerskelfalse" +\end{tabular} +\end{center} +This feature is off by default, because it's distracting, +but it's useful in the early stages of design when you want +to judge the precise placement of the heads and feet, or +later when you want to see how unusual features like +displayed material or marginal notes fit on the page in relation +to the main text. + +When the page frame and inner skeleton are both turned on, +you can see at a glance almost all the parameters that +\LaTeX\ uses to lay out a page. The width of the text rectangle +is \verb"\textwidth", the distance from the edge of the +text rectangle to the outer edge of the (trimmed) paper is +\verb"\evensidemargin", +and the distance from the text rectangle to the inner edge of the +paper is \verb"\oddsidemargin". The distance from the top of +the (trimmed) paper to the rule that represents the top of +the page header is \verb"\topmargin", the distance from the top +of the header to the bottom is \verb"\headheight", and the distance +from the bottom of the header to the top of the text rectangle is +\verb"\headsep". The height of the text rectangle is \verb"\textheight", +the distance from the baseline of the text rectangle to the +baseline of the footer is \verb"\footskip", and the distance +from the top to the bottom of the footer is \verb"\footheight". +The section {\it Things You Need To Know\/} later in this document +has a more detailed discussion of some of these parameters. + +The inner skeleton can be turned on +without the page frame, although that seems to me to be +of questionable value. I can see wanting the page frame +without the inner skeleton, but not vice versa. However, +the switches are independent. + +%% +\pagebreak +\pageframetrue +\innerskelfalse +%% +\section{The Text Grid} +Another optional feature is a grid laid +over\footnote{well, actually under---it's +laid on the page {\em before\/} the text---but you usually +won't be able to tell the difference} the text body. +This can be useful for measuring the leading +(\LaTeX's \verb"\baselineskip" parameter), or space above and +below a display or section head. The text grid will not be +displayed unless the \verb"innerskel" switch is on. Even then, +the grid is omitted unless the \verb"textgrid" switch is also on, +which it is by default. As usual, you can turn it off and on +with the commands +\begin{center} +\begin{tabular}{l} +\verb"\textgridfalse"\\ +\verb"\textgridtrue" +\end{tabular} +\end{center} + +Although a grid makes it almost impossible to read the text +on a page, it can be useful when you are trying +to gauge parameters that affect the layout of the text +within the text rectangle +(rather than the parameters listed earlier, which +affect the way the larger features of the page --- header, +footer, and text area as a whole --- are arranged). Text +layout parameters include the \verb"\baselineskip", the +\verb"\parskip", the \verb"\parindent", the \verb"\topskip", +the space above and below section heads +(usually specified in a style file as arguments to the +\verb"\@startsection" macro), space around figures, tables, +and lists, space above footnotes, and many others. + +The next two pages show grids of different sizes laid +over the text body. The first page uses the default grid, +which is composed of squares 10pt on a side. The grid on the +following page has rectangles 10 picas wide and 15 points high; +this was specified with the command +\begin{center} +\verb"\gridsize{10pc}{15pt}" +\end{center} +The grid size that is in effect when a page is +actually sent to the \verb"dvi" file is the one that is used +for that page. + +\pagebreak +\innerskeltrue +\textgridtrue +{\Large +This page has the default grid, which consists of squares 10pt on a side.} + +\fourtestpars +\pagebreak +\gridsize{10pc}{15pt}% +{\Large +This page has a grid with vertical lines 10pc apart and +horizontal lines 15pt apart.} + +\fourtestpars +%% +\columnsep 2pc +\twocolumn +\textgridfalse +\section{Two-Column Format} +As you can see, the inner skeleton does work on a page in +two-column format, but it still outlines the text body as +a whole (rather than outlining each column separately). +Similarly, a text grid on a two-column page +covers both columns together +(not each column separately). To treat the columns +as separate objects, I would have had to alter +much more of \LaTeX's output routine than I was +comfortable with. And that approach still would not +be able to handle \LaTeX\ extensions like +Frank Mittelbach's \verb"multicol" style option, which are +increasingly used instead of \LaTeX's built-in +two-column feature. So I decided to punt. + +The rest of this page is simply filler. + +\testpar\testpar\testpar +\onecolumn +\innerskelfalse +%% +\section{Things You Need To Know} +This section details a few more things you need to know before you +use the \verb"pageframe" document style option. + +One of the basic assumptions underlying the \verb"pageframe" code +is that your document is being laid out for back-to-back two-sided +printing (remember, \verb"pageframe" was created primarily to assist in book +production). As explained below, this assumption is used in calculating +the width of the trimmed pages, so the frame may have the wrong width +if you use \verb"pageframe" with a one-sided document +style. Note that the standard \LaTeX\ \verb"article" and \verb"report" +document styles both accept \verb"twoside" as an option, so a document +that begins +\begin{center} +\verb"\documentstyle[twoside,pageframe]{article}" +\end{center} +(for example) should come out just fine. + +Strictly speaking, +\LaTeX\ doesn't know how wide your page is---it doesn't place anything +on the page to the right of the text body, so it doesn't care how +much farther out the edge of the paper is. For this reason \LaTeX\ only +provides parameters to specify the widths of the left-hand margins +(\verb"\oddsidemargin" for odd-numbered pages, and \verb"\evensidemargin" +for even-numbered pages). How then do we figure out where +to put the corner marks and rules that mark the right-hand edge +of the paper? We do it by assuming that the right-side margin +on a recto (= right-hand-side = odd-numbered) page is equal to +the left-side margin on a verso (= left-hand-side = even-numbered) page, +and vice versa. This is usually the case, because +otherwise the text rectangles of the pages on the +opposite sides of a leaf wouldn't line up +back-to-back.\footnote{Books are occasionally designed that way, +but it often looks horrible, +because the mass of ink in the text area on the back of a page is usually +dark enough to show through. +That isn't a problem if the text rectangles are aligned, because the text +ink is dark enough that the eye doesn't notice the ``ghost'' from the +other side of the leaf.} +Therefore the \verb"pageframe" style option assumes that the +\verb"\evensidemargin" is the fore-edge margin for all pages (recto +and verso), and the \verb"\oddsidemargin" is the gutter +margin for all pages.\footnote{This is correct: note that the left edge +of a recto page is in the gutter, while the left edge of a verso page +is at the fore-edge.} +It computes the width of a (trimmed) page +to be the sum of the width of the text body (which is given by \LaTeX's +\verb"\textwidth" parameter) and the widths of the fore-edge and gutter +margins. (I could remove this assumption, having the user instead specify +the page width explicitly, and I will do so if user feedback shows +a demand for this.) + + +Unfortunately, there is +no parameter, or sum of parameters, that tells us the +total height of a page. Once again, \LaTeX\ doesn't need +to know that. It simply starts at the top of the page, laying down +space above the header (the \verb"\topmargin"), then the header +(a box of height \verb"\headheight"), then space below the header and +above the text body (the \verb"\headsep"), then the text body +(a box of height \verb"\textheight"), then the footer +(a box of height \verb"\footheight" whose baseline is a distance +\verb"\footskip" below the bottom of the text body). +Since \LaTeX\ places nothing on the page below the footer, +it doesn't care---and doesn't know---how far below the footer +the physical edge of the printed page will fall. +And there's no clever assumption that we can make to figure +it out, as we did in computing the paper width. +The top-to-bottom analogue of the left-to-right reflection argument +given above doesn't work: there's no reason why the distance +below the footer on recto +pages should equal the distance above the header on verso +pages.\footnote{If books were bound across the top +instead of along the side, this would be true---but then +the left and right margins would be +independent and you'd have to specify the width of a page. You can't win.} +This means that +in order for the bottom corner marks to be placed in the right +positions I had to provide a way for you to specify the +trim height of the paper. +You do it this way: +\begin{center} +\verb"\paperheight{9in}" +\end{center} +This declaration goes in the preamble of your \LaTeX\ document (after +the \verb"\documentstyle" command but before the \verb"\begin{document}" +command). If you omit it, the rules that outline +the left and right edges of the page in the page frame will disappear, +and the bottom corner marks will abut the footer. + +There is a half-truth in the preceding paragraph, regarding the height +of the page footer. The \LaTeX\ manual does state +(on page 163) that \verb"\footheight" is the height of the +box into which the page's footer is placed, and the code for +\verb"pageframe" acts as if this were so. +But \LaTeX\ doesn't actually work that way. +In fact, the file \verb"latex.tex" contains a comment +to the effect that the \verb"\footheight" parameter is never +used by \LaTeX{}, and this does seem to be the case. +The standard \verb"article", \verb"book", and \verb"report" document +styles do not even specify a value for \verb"\footheight", leaving it +at its default setting of 0pt. With this setting, the upper and lower +rules drawn by \verb"\innerskeltrue" to demarcate the footer will coincide, +so you'll only see a single line on the page, representing the baseline of +the page footer. The document you're now reading arbitrarily +sets \verb"\footheight" +to 10pt just to illustrate how the inner skeleton was intended to look, +but you should be aware that it's not a bug in the \verb"pageframe" code +if you see only a single line indicating the position of the footer. + +\setcounter{page}{1} +I reset the page number counter to 1 on this page to demonstrate +that the sheet sequence number in the tag line at the top of a page +is independent of the page number printed on the page. +Even if a book design calls for a roman-numeral page $i$ and +a new page 1 for every part or chapter, there will still +be only one page with sheet number 1. + +\pagebreak +\pffont{cmti10} +By default the tag line across the top of the page +is printed in whatever font is current while \LaTeX\ is +loading the \verb"pageframe" style file (this is ordinarily +\verb"cmr10", but some installations might be configured +with different fonts). You can select any font you like for +the tag lines with the \verb"\pffont" command. +I reset the tag line font on this page to \verb"cmti10" by putting +the declaration \verb"\pffont{cmti10}" just before this paragraph. +A tag line font that you declare in this way takes effect as soon as +\LaTeX\ ships out the next page to the \verb"dvi" file, and +remains in effect through the end of the document (unless you +give another \verb"\pffont" command). Remember that because of the +way output routines work in \TeX\ the next page shipped out +might actually be the page before or after the one on which the +\verb"\pffont" declaration would seem to fall by its position +in the source file. + +Observe that the arms of the corner marks do not quite meet, +but are positioned +so that if they were extended to meet, the meeting point would be +the corner of the paper. The gap allows leeway for +positioning and cutting the paper. The current version of +\verb"pageframe" doesn't allow you to control the lengths of the +corner marks, the size of the gaps between them and the page corners, +or the distance between the tag line and the top of the page +frame, but it wouldn't be too hard to parametrize these. +I didn't do it because I didn't see a reason to, but I will +if there's demand. + +Just in case you're worried about all these extra words and rules +on the page +throwing off the measurements, relax! The code for \verb"pageframe" +uses constructions like \verb"\llap" and \verb"\rlap" to ``hide'' the +height, width, and depth of every mark that it places on the page, +so that the marks placed by your document (text, illustrations, +or whatever) fall into exactly the same positions when you +use \verb"pageframe" as when you don't. + +Piet van~Oostrum has written the \verb"fancyheadings" style option +to provide enhanced formatting capabilities for running heads +and feet. This style option allows for +\begin{itemize} +\item three-part headers and footers +\item rules in header and footer +\item headers and footers wider than \verb|\textwidth| +\item multiline headers and footers +\item separate headers and footers for even and odd pages +\item separate headers and footers for chapter pages +\end{itemize} +To provide extra-wide headers and footers, \verb"fancyheadings" +defines a new dimension parameter, \verb"\headwidth", which it uses +instead of \verb"\textwidth" to specify the widths of the +boxes in which the running heads and feet are constructed. +The \verb"pageframe" style option does not take account of this +new parameter, and continues to draw its rules outlining header +and footer at width \verb"\textwidth". It would be possible +to make \verb"pageframe" sensitive to \verb"fancyheadings", using +\verb"\headwidth" if \verb"fancyheadings" is in effect and +\verb"\textwidth" otherwise. +I'm willing to do this if there is any demand for it. +(Keep those cards and letters coming in, folks!) + +The use of the margin parameters (\verb"\topmargin", +\verb"\evensidemargin", and \verb"\oddsidemargin") calls for +further comment. The \LaTeX\ manual (on page 163 again) defines +the margin parameters to be ``one inch less than the distance +from the [top or left] edge of the paper'' to the running head +or the text (as appropriate). Why ``one inch less''? Well, +it so happens (although the \LaTeX\ manual doesn't tell you this) that +\TeX\ always uses a point one inch down from the top edge of the +paper and one inch right of the left edge of the paper as the +origin of its coordinate system, and all the marks on the paper +are positioned relative to that point. You'll have to read +{\it \TeX: The Program\/} (Volume B of the Computers \& Typesetting +series) for an explanation of why it's done +that way (or do what I'm doing: wait for the movie). At any rate, +\LaTeX's margin parameters are {\em really\/} measuring relative +to \TeX's origin point, not the corner of the paper. For that reason +I used that point as the upper left corner of the ``virtual'' page +area (to which the larger actual paper will be trimmed when the +book is bound), and that's why this document speaks of \verb"\topmargin", +\verb"\evensidemargin", and \verb"\oddsidemargin" as specifying the +actual margins (relative to the trimmed page area) rather than +``one inch less than'' the actual margins. + +Incidentally, suppose you're working with a document design +that calls for pages a bit wider than $7\frac12{\rm in}$ or taller +than $10{\rm in}$, and you want to proof the document on +$8\frac12{\rm in}\times11{\rm in}$ paper. Does the fact that +\TeX's origin is set down and in by one inch make this impossible? +No! Should you use negative values of \verb"\topmargin", +\verb"\evensidemargin", and \verb"\oddsidemargin" to move the text +farther up and to the left than it would ordinarily go? Well, +you can, but you will get very confusing results---for example, +a negative \verb"\topmargin" will cause the running head to overstrike +the tag line that \verb"pageframe" puts across the top of the sheet. +Mind you, \verb"pageframe" doesn't complain or malfunction; it just +does what you told it to do. Still, to obtain useful results, you should +always use positive values for the margin parameters. How can you +fit a wide or tall page onto the paper, then? You can use a feature +of \TeX\ that (regrettably) isn't documented in the \LaTeX\ manual: +\verb"\hoffset" and \verb"\voffset". These parameters tell \TeX\ to +displace its origin horizontally or vertically (respectively) from +its usual $(1{\rm in},1{\rm in})$ position. They both normally have the +value 0pt, but if you put +\begin{center} +\begin{tabular}{l} +\verb"\hoffset -0.5in"\\ +\verb"\voffset -0.25in" +\end{tabular} +\end{center} +(for example) +into the preamble of your document, then every mark on every page will +be shifted a quarter inch up and a half inch to the left of where it +would have been. Using the \verb"\hoffset" and \verb"\voffset" parameters +makes a single adjustment in the \verb"dvi" file, so it affects all +marks the same way (including those made by \verb"pageframe"), and they +all maintain their relative positions to one another. Of course, if you +move the origin up too far (more than about half an inch), then the +tag line across the top of the sheet will fall off the top edge of the +paper; your device driver may or may not accept this gracefully. +On the other hand, if you are printing the document directly (rather +than printing a camera-ready repro from which to make a printing +plate), you might want to move the origin up one inch and left one +inch; that way the upper left corner of the virtual page will coincide +with the physical upper left corner of the paper and you'll only have +to trim the sheets on two sides instead of four. + +One last caveat: the \verb"pageframe" style option does its work by +substituting new code for a part of \LaTeX's output routine +(specifically, the \verb"\@outputpage" subroutine). +This means that any other document style option that also attempts +to hook into or replace this part of the output routine will +be incompatible +with the \verb"pageframe" option. It isn't very common for style +files to do this, but it does happen. +%% +{\catcode`\|=0 |catcode`|\=12 |gdef|bslash{\}} +%% +\newenvironment{cmdlist}% +{\begin{list}{}% +{\leftmargin 3.5cm\rightmargin 0cm\labelwidth 3cm\labelsep .5cm +\itemsep\baselineskip\listparindent\parindent}% +}% +{\end{list}} +%% +\section{Summary} +This section summarizes the user commands provided by the +\verb"pageframe" style option. The code for \verb"pageframe" +also defines some ``private'' control sequences that are not intended +to be used directly; all such control sequences have \verb"@" signs +in their names. + +\begin{cmdlist} +% +\item[\tt\bslash paperheight] +The command \verb"\paperheight{HT}" (where \verb"HT" +is a \TeX\ dimension specification) tells the \verb"pageframe" +code that the trimmed height of the paper on which your document +will ultimately appear is \verb"HT". This is used to determine +how far down the page the bottom corner marks are positioned. +This should be specified in the preamble of your document +(after the \verb"\documentstyle" command and before the +\verb"\begin{document}" command). If you forget to declare +a paper height, the bottom corner marks will be positioned parallel +with the bottom of the footer. +% +\item[\tt\strut\vtop to 0pt{% +\hbox{\bslash pageframetrue}% +\hbox{\bslash pageframefalse}% +\vss}] +The conditional \verb"\ifpageframe" is used +in the code for \verb"pageframe" to control the printing of the +rectangle that outlines the trim edges of the paper. +It is true by default (so the rectangle is printed); +you will want to turn it off before printing a final copy +of your document. +% +\item[\tt\strut\vtop to 0pt{% +\hbox{\bslash innerskeltrue}% +\hbox{\bslash innerskelfalse}% +\vss}] +The conditional \verb"\ifinnerskel" is used +to control the printing of the +rectangle around the text area and the rules that +outline the header and footer. +It is false by default (so the inner skeleton is not printed). +Turning off the inner skeleton also disables the text grid feature. +% +\item[\tt\strut\vtop to 0pt{% +\hbox{\bslash textgridtrue}% +\hbox{\bslash textgridfalse}% +\vss}] +The conditional \verb"\iftextgrid" is used, together with the +\verb"\ifinnerskel" conditional, +to control the printing of a grid over the main text area of the +page. It is true by default; however, this is not sufficient to +cause the text grid to appear. +If the inner skeleton is turned off, the text grid is not printed, +regardless of the setting of the \verb"textgrid" switch. The text +grid is only printed if the \verb"innerskel" and \verb"textgrid" +switches are both on. The default grid is made up of squares 10pt +on a side; it can be reset with the \verb"\gridsize" command. +% +\item[\tt\bslash gridsize] +The command \verb"\gridsize{WD}{HT}" (where \verb"WD" and \verb"HT" +are \TeX\ dimension specifications) causes the text grid to be drawn +with vertical rules separated by \verb"WD" and horizontal rules +separated by \verb"HT" (so the grid cells are rectangles of dimensions +${\tt WD}\times{\tt HT}$). +% +\item[\tt\bslash pffont] +The command \verb"\pffont{FONTSPEC}" causes the tag line across +the top of each page to be printed in the font specified by +the \verb"FONTSPEC", which should be a font designation such as +\verb"cmr10" or {\tt times at 12pt} or {\tt cmbx10 scaled +\bslash magstep2}. +% +\end{cmdlist} +%% +\section{Acknowledgements} +The author of the \verb"pageframe" document style option is +very grateful for the assistance of Irma Tani, who beta tested +both the \TeX\ code and the documentation and suggested many +improvements in both. Having professional experience +in book production (which the author completely lacks), she was able +to say what features would be useful in real applications. +Brian Junker also made very helpful comments about the beta +version of the documentation. +%% +\section{Feedback} +The author of the \verb"pageframe" document style option +used it for over a year in both large and +small documents before releasing it for beta testing, and the code +went through several conceptual overhauls during that time. +He now believes it to be, not perfect, but complete enough and +clean enough to be widely useful. +Even so, he realizes that errors and pitfalls may remain, and +he would be grateful to receive reports of them, whether they +represent coding gaffes that cause malfunctions, or infelicities +of design that make \verb"pageframe" hard to use. His name is Cameron +Smith, and he can be reached through electronic mail +as \verb"cameron@midd.cc.middlebury.edu" +or \verb"cameron@symcom.math.uiuc.edu", or by telephone +at (513) 429-2707. +%% +\section{Claims and Disclaimers} +% +This document and the computer code in the file +\verb"pageframe.sty" are copyright 1991 +by the author, Cameron Smith. Permission is granted to all to use the +code (by executing it on a computer) without fee, but {\em not\/} to +sell it or to incorporate it into other works offered for sale. + +The computer code described in this document is offered in hopes that +it will be found useful, and in the belief that it is correct, +but it is offered without any +warranty of any kind, including warranty of fitness for any purpose. +Users of this code do so entirely at their own risk. The author +neither admits nor accepts any liability for any loss, direct, +indirect, consequential, incidental, or otherwise, resulting +from the use of the computer code described herein. The statements +in this document are believed to be complete and accurate but +are not warranted to be so, and remedy for any omissions or inaccuracies +is limited to the issuance of a corrected version of the document. +%% +\end{document} diff --git a/macros/latex209/contrib/pageframe/pgframet.tex b/macros/latex209/contrib/pageframe/pgframet.tex new file mode 100644 index 0000000000..b8e94e60c4 --- /dev/null +++ b/macros/latex209/contrib/pageframe/pgframet.tex @@ -0,0 +1,43 @@ +\documentstyle[pageframe]{book} +%% +\paperheight{9in} +\footheight 10pt +%% +\newcount\foo\def\testsen{\advance\foo by1% +This is test sentence number \the\foo. }% +\def\testsenfive{\testsen\testsen\testsen\testsen\testsen}% +\newcount\bar\def\testpar{\advance\bar by1% +This is test paragraph number \the\bar. +\testsenfive\testsenfive\testsenfive\par}% +\def\fourtestpars{\testpar\testpar\testpar\testpar} +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +\begin{document} +%% +\pageframefalse +%% +\section{first} +\fourtestpars\fourtestpars +%% +\pageframetrue +%% +\section{second} +\fourtestpars +%% +\innerskeltrue +%% +\section{third} +\fourtestpars\fourtestpars +%% +\gridsize{12pt}{15pt}% +%% +\section{fourth} +\fourtestpars\testpar\testpar +%% +\textgridfalse +%% +\section{fifth} +\fourtestpars +%% +\end{document} |