Debian Codegraph @

texmf-dist/source/latex/preprint/fullpage.dtx

raw
1 % \iffalse THIS IS A META-COMMENT
2 %<*dtx>
3 \ProvidesFile
4 %========================================================================
5 {FULLPAGE.DTX}
6 %========================================================================
7 %</dtx>
8 %% Copyright 1994-1999 Patrick W Daly
9 %% Max-Planck-Institut f\"ur Aeronomie
10 %% Max-Planck-Str. 2
11 %% D-37191 Katlenburg-Lindau
12 %% Germany
13 %% E-mail: [email protected]
14 %
15 % This program can be redistributed and/or modified under the terms
16 % of the LaTeX Project Public License Distributed from CTAN
17 % archives in directory macros/latex/base/lppl.txt; either
18 % version 1 of the License, or any later version.
19 %
20 % This is a contributed file to the LaTeX2e system.
21 % -------------------------------------------------
22 % This is a LaTeX package to set all margins to 1in or 1.5cm
23 % Installation:
24 % LaTeX this file: creates docstrip installation file fullpage.ins
25 % AND the (LaTeX2e) documentation
26 % (La)TeX fullpage.ins: creates package files fullpage.sty, and optionally
27 % doc driver fullpage.drv
28 % (fullpage.ins may be edited as needed)
29 % Docstrip options available:
30 % package - to produce a (LaTeX2e) package .sty file
31 % driver - to produce a driver file to print the documentation
32 %--------------------------------------------------------------------------
33 % *** Identify the package file:-
34 %<package>\NeedsTeXFormat{LaTeX2e}[1994/06/01]
35 %<package>\ProvidesPackage{fullpage}
36 %
37 % *** Identify the driver file:-
38 %<driver>\NeedsTeXFormat{LaTeX2e}
39 %<driver>\ProvidesFile{fullpage.drv}
40 %
41 % *** The DATE, VERSION, and other INFO
42 %\fi
43 %\ProvidesFile{fullpage}
44 [1999/02/23 1.1 (PWD)]
45 % \changes{1.0}{1994 Feb 15}{Initial version}
46 % \changes{1.0a}{1994 Jun 15}{Documentation as per \LaTeXe: driver at start}
47 % \changes{1.0b}{1997 Apr 29}{Conform to new \texttt{docstrip}}
48 % \changes{1.1}{1999 Feb 23}{Update copyright notice}
49 %
50 % \CheckSum{74}
51 % \CharacterTable
52 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
53 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
54 % Digits \0\1\2\3\4\5\6\7\8\9
55 % Exclamation \! Double quote \" Hash (number) \#
56 % Dollar \$ Percent \% Ampersand \&
57 % Acute accent \' Left paren \( Right paren \)
58 % Asterisk \* Plus \+ Comma \,
59 % Minus \- Point \. Solidus \/
60 % Colon \: Semicolon \; Less than \<
61 % Equals \= Greater than \> Question mark \?
62 % Commercial at \@ Left bracket \[ Backslash \\
63 % Right bracket \] Circumflex \^ Underscore \_
64 % Grave accent \` Left brace \{ Vertical bar \|
65 % Right brace \} Tilde \~}
66 %
67 %\iffalse
68 %<*install>
69 %^^A =============================================
70 %^^A Here is the docstrip installation file
71 %^^A It is written on first LaTeX run if it
72 %^^A does not already exist
73 %^^A =============================================
74 \begin{filecontents*}{fullpage.ins}
75 % File: fullpage.ins
76 % Copyright 1999 Patrick W. Daly
77 %
78 % This file can be redistributed and/or modified under the terms
79 % of the LaTeX Project Public License Distributed from CTAN
80 % archives in directory macros/latex/base/lppl.txt; either
81 % version 1 of the License, or any later version.
82 %
83 % It is an installation file for extracting package and driver
84 % files from the original source file. Simply process it under
85 % TeX or LaTeX.
86
87 \input docstrip
88
89 \preamble
90 =============================================
91 IMPORTANT NOTICE:
92
93 This program can be redistributed and/or modified under the terms
94 of the LaTeX Project Public License Distributed from CTAN
95 archives in directory macros/latex/base/lppl.txt; either
96 version 1 of the License, or any later version.
97
98 This is a generated file.
99 It may not be distributed without the original source file \inFileName.
100
101 Full documentation can be obtained by LaTeXing that original file.
102 Only a few abbreviated comments remain here to describe the usage.
103 =============================================
104 \endpreamble
105 \postamble
106
107 <<<<< End of generated file <<<<<<
108 \endpostamble
109
110 \declarepreamble\driver
111 ============================================
112 This is the driver file to produce the LaTeX documentation
113 from the original source file \inFileName.
114
115 Make changes to it as needed. (Never change the file \inFileName!)
116 ============================================
117 \endpreamble
118
119 \declarepostamble\driverq
120
121 End of documentation driver file.
122 \endpostamble
123
124 \keepsilent
125 \askforoverwritefalse
126
127 \generate{\file{fullpage.sty}{\from{fullpage.dtx}{package}}
128 \file{fullpage.drv}{\usepreamble\driver\usepostamble\driverq
129 \from{fullpage.dtx}{driver}}
130 }
131
132 \obeyspaces
133 \Msg{*******************************************}%
134 \Msg{* For documentation, process fullpage.dtx *}%
135 \Msg{* or the driver file fullpage.drv *}%
136 \Msg{*******************************************}
137
138 \endbatchfile
139 \end{filecontents*}
140 %</install>
141 %<*driver>
142 \documentclass{ltxdoc}
143 %<driver>%\documentclass[twoside]{ltxdoc}
144 %<driver>%\documentclass[a4paper]{ltxdoc}
145 %<driver>%\documentclass[twoside,a4paper]{ltxdoc}
146 \raggedbottom
147
148 %** To include the detailed explanation of the coding, comment out
149 %** the next line
150 \OnlyDescription
151
152 %** To produce a command index: add the following line for one run,
153 %** then run makeindex -s gind.ist natbib
154 %** and reprocess, with or without this line (much faster without)
155 %<driver>% \EnableCrossrefs\CodelineIndex
156
157 %** To produce a change history: add the following line for one run,
158 %** then run makeindex -s gglo.ist -o natbib.gls natbib.glo
159 %** and reprocess, with or without this line (faster without)
160 %<driver>% \RecordChanges
161
162 \DisableCrossrefs %May stay; zapped by \EnableCrossrefs
163 \CodelineNumbered %May stay
164
165 \begin{document}
166 \DocInput{fullpage.dtx}
167 \end{document}
168 %</driver>
169 %\fi
170 %
171 % \DoNotIndex{\begin,\CodelineIndex,\CodelineNumbered,\def,\DisableCrossrefs}
172 % \DoNotIndex{\DocInput,\documentclass,\EnableCrossrefs,\end,\GetFileInfo}
173 % \DoNotIndex{\NeedsTeXFormat,\OnlyDescription,\RecordChanges,\usepackage}
174 % \DoNotIndex{\ProvidesClass,\ProvidesPackage,\ProvidesFile,\RequirePackage}
175 % \DoNotIndex{\LoadClass,\PassOptionsToClass,\PassOptionsToPackage}
176 % \DoNotIndex{\DeclareOption,\CurrentOption,\ProcessOptions,\ExecuteOptions}
177 % \DoNotIndex{\AtEndOfClass,\AtEndOfPackage,\AtBeginDocument,\AtEndDocument}
178 % \DoNotIndex{\InputIfFileExists,\IfFileExists,\ClassError,\PackageError}
179 % \DoNotIndex{\ClassWarning,\PackageWarning,\ClassWarningNoLine}
180 % \DoNotIndex{\PackageWarningNoLine,\ClassInfo,\PackageInfo,\MessageBreak}
181 % \DoNotIndex{\space,\protect,\DeclareRobustCommand,\CheckCommand}
182 % \DoNotIndex{\newcommand,\renewcommand,\providecommand\newenvironment}
183 % \DoNotIndex{\renewenvironment,\newif,\newlength,\newcounter,\setlength}
184 % \DoNotIndex{\setcounter,\if,\ifx,\ifcase,\ifnum,\texttt,\textbf,\textrm}
185 % \DoNotIndex{\textsl,\textsc,\textup,\textit,\textmd,\textsf,\emph}
186 % \DoNotIndex{\ttfamily,\rmfamily,\sffamily,\mdseries,\bfseries,\upshape}
187 % \DoNotIndex{\slshape,\scshape,\itshape,\em,\LaTeX,\LaTeXe}
188 % \DoNotIndex{\addtolength,\pagestyle,\paperheight,\paperwidth}
189 % \DoNotIndex{\filename,\fileversion,\filedate,\let,\fi}
190 %
191 % \setcounter{IndexColumns}{2}
192 % \setlength{\IndexMin}{10cm}
193 % \setcounter{StandardModuleDepth}{1}
194 %
195 % \GetFileInfo{fullpage}
196 %
197 % \title{\bfseries A Package to Set Margins to Full Page}
198 %
199 % \author{Patrick W. Daly}
200 %
201 % \date{This paper describes package \texttt{\filename}\\
202 % version \fileversion{} from \filedate\\[1ex]
203 % \textsl{It is part of the \texttt{preprint} collection of packages}\\
204 % }
205 %
206 % \maketitle
207 %
208 % \pagestyle{myheadings}
209 % \markboth{P. W. Daly}{SETTING PAGE MARGINS FOR FULL PAGE}
210 %
211 %^^A In order to keep all marginal notes on the one (left) side:
212 %^^A (otherwise they switch sides disasterously with twoside option)
213 % \makeatletter \@mparswitchfalse \makeatother
214 %
215 %\begin{small}\begin{center}\bfseries Summary\end{center}
216 % The stripped version of this file contains the following brief description:
217 %\iffalse
218 %<*package>
219 %\fi
220 % \begin{verbatim}
221 % Sets all 4 margins to be either 1 inch or 1.5 cm, and specifies
222 % the page style
223 % Call as \usepackage[options]{fullpage}
224 % Options = in (default) for 1 inch
225 % cm for 1.5 cm
226 % plain (default) sets \pagestyle{plain}
227 % empty sets \pagestyle{empty}
228 % headings sets \pagestyle{headings}
229 % myheadings sets \pagestyle{myheadings}
230 % \end{verbatim}
231 %\iffalse
232 %-----------------------------------------------------------
233 %</package>
234 %\fi
235 %\end{small}
236 %
237 % \section{Purpose}
238 % This package is called \texttt{\filename}, and it sets the text height
239 % and width and the margins such that the page is almost full. It only
240 % leaves a uniform margin on all four sides.
241 %
242 % To do this, it needs to know how big the full page is, whether US letter
243 % size ($8\frac{1}{2} \times 11''$) or A4 ($21 \times 29.7$~cm), or some
244 % other size. This is given in the parameters |\paperwidth| and
245 % |\papersize| that are set by the appropriate option in the
246 % |\documentclass| command.
247 %
248 % The package must also know which page style is being employed. This is
249 % because it must leave space for possible headers and footers, if they are
250 % present. If not, it may use that space for text.
251 %
252 % \section{Invoking the Package}
253 % The package is called after the |\documentclass| command as e.g.,
254 % \begin{quote}
255 % |\documentclass[a4paper,landscape]{article}|\\
256 % |\usepackage[|\emph{options}|]{|\texttt{\filename}|}|
257 % \end{quote}
258 % where possible options for \texttt{\filename} are
259 % \begin{quote}\begin{description}
260 % \item[\tt in] (default) sets the margins to one inch;
261 % \item[\tt cm] sets the margins to 1.5~cm (one centimeter is really too
262 % little);
263 % \item[\tt plain] (default) selects the \texttt{plain} page style, i.e.,
264 % with no headers but only a footer;
265 % \item[\tt empty] for neither headers nor footers;
266 % \item[\tt headings] for both header and footers;
267 % \item[\tt myheadings] also for both headers and footers.
268 % \end{description}\end{quote}
269 % For the last 4 options, the corresponding |\pagestyle| declaration is
270 % executed, so that it is not necessary to give it again.
271 %
272 % \StopEventually{\PrintIndex\PrintChanges}
273 %
274 % \section{Options with \texttt{docstrip}}
275 % The source \texttt{.dtx} file is meant to be processed with
276 % \texttt{docstrip}, for which a number of options are available:
277 % \begin{description}
278 % \item[\tt package] to produce a \texttt{.sty} package file with most
279 % comments removed;
280 % \item[\tt driver] to produce a driver \texttt{.drv} file that will print
281 % out the documentation under \LaTeXe. The documentation cannot be
282 % printed under \LaTeX~2.09.
283 % \end{description}
284 % The source file \texttt{\filename.dtx} is itself a driver file and can
285 % be processed directly by \LaTeXe.
286 %
287 % \section{The Coding}
288 % This section presents and explains the actual coding of the macros.
289 % It is nested between |%<*package>| and |%</package>|, which
290 % are indicators to \texttt{docstrip} that this coding belongs to the package
291 % file.
292 %
293 % \begin{macro}{\FP@margin}
294 % Define the options with help of the length |\FP@margin|. The options |in|
295 % and |cm| select the actual margin size.
296 % \begin{macrocode}
297 %<*package>
298 \newlength{\FP@margin}
299 \DeclareOption{in}{\setlength{\FP@margin}{1in}}
300 \DeclareOption{cm}{\setlength{\FP@margin}{1.5cm}}
301 % \end{macrocode}
302 % \end{macro}
303 %
304 % \begin{macro}{\ifFP@plain}
305 % \begin{macro}{\ifFP@empty}
306 % The remaining options determine the page style, and need two flags to
307 % keep track of whether headers and footers are present.
308 % \begin{macrocode}
309 \newif\ifFP@plain
310 \newif\ifFP@empty
311 \DeclareOption{plain}{\FP@plaintrue \FP@emptyfalse
312 \pagestyle{plain}}
313 \DeclareOption{empty}{\FP@plaintrue \FP@emptytrue
314 \pagestyle{empty}}
315 \DeclareOption{headings}{\FP@plainfalse \FP@emptyfalse
316 \pagestyle{headings}}
317 \DeclareOption{myheadings}{\FP@plainfalse \FP@emptyfalse
318 \pagestyle{myheadings}}
319 % \end{macrocode}
320 % \end{macro}\end{macro}
321 %
322 % Invoke the default options and then process the requested ones. Use the
323 % starred version of |\ProcessOptions| so that the options are executed
324 % in the order they were specified (not defined). Thus if someone gives
325 % conflicting options (like |in| and |cm|) then the last one in the list
326 % counts.
327 % \begin{macrocode}
328 \ExecuteOptions{in,plain}
329 \ProcessOptions*
330 % \end{macrocode}
331 %
332 % \begin{macro}{\headheight}
333 % \begin{macro}{\headsep}
334 % If there are to be no headers (for options |empty| and |plain|, which both
335 % set |\ifFP@plain| to be \meta{true}), zero the appropriate parameters.
336 % \begin{macrocode}
337 \ifFP@plain
338 \setlength{\headheight}{0pt}
339 \setlength{\headsep}{0pt}
340 \fi
341 % \end{macrocode}
342 % \end{macro}\end{macro}
343 %
344 % \begin{macro}{\footskip}
345 % If there are to be not footers, zero the |\footskip| parameter. This
346 % occurs only for page style |empty|, for although the two |headings|
347 % styles do not include a footer, they are often used in conjunction with a
348 % |\thispagestyle{plain}| command for the first page of a document.
349 % \begin{macrocode}
350 \ifFP@empty
351 \setlength{\footskip}{0pt}
352 \fi
353 % \end{macrocode}
354 % \end{macro}
355 %
356 % \begin{macro}{\textwidth}
357 % \begin{macro}{\oddsidemargin}
358 % \begin{macro}{\evensidemargin}
359 % Calculate the width of the text from |\paperwidth| and set the left and
360 % right margins. Recall that \TeX{} automatically leaves a margin of $1''$.
361 % \begin{macrocode}
362 \setlength{\textwidth}{\paperwidth}
363 \addtolength{\textwidth}{-2\FP@margin}
364 \setlength{\oddsidemargin}{\FP@margin}
365 \addtolength{\oddsidemargin}{-1in}
366 \setlength{\evensidemargin}{\oddsidemargin}
367 % \end{macrocode}
368 % \end{macro}\end{macro}\end{macro}
369 %
370 % \begin{macro}{\textheight}
371 % \begin{macro}{\topmargin}
372 % Calculate the height of the text from |\paperwidth|, by removing the
373 % margins, headers, and footers. Set the top margin, recalling that \TeX{}
374 % automatically leaves $1''$.
375 % \begin{macrocode}
376 \setlength{\textheight}{\paperheight}
377 \addtolength{\textheight}{-\headheight}
378 \addtolength{\textheight}{-\headsep}
379 \addtolength{\textheight}{-\footskip}
380 \addtolength{\textheight}{-2\FP@margin}
381 \setlength{\topmargin}{\FP@margin}
382 \addtolength{\topmargin}{-1in}
383 %</package>
384 % \end{macrocode}
385 % \end{macro}\end{macro}
386 %
387 % \Finale