| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (C) 2009-2010 by Karl Wette |
| 4 |
% |
| 5 |
% This file may be distributed and/or modified under the conditions of |
| 6 |
% the LaTeX Project Public License, either version 1.2 of this license |
| 7 |
% or (at your option) any later version. The latest version of this |
| 8 |
% license is in: |
| 9 |
% |
| 10 |
% http://www.latex-project.org/lppl.txt |
| 11 |
% |
| 12 |
% and version 1.2 or later is part of all distributions of LaTeX version |
| 13 |
% 1999/12/01 or later. |
| 14 |
% |
| 15 |
% \fi |
| 16 |
% |
| 17 |
% \iffalse |
| 18 |
%<*driver> |
| 19 |
\ProvidesFile{emptypage.dtx} |
| 20 |
%</driver> |
| 21 |
%<*package> |
| 22 |
\NeedsTeXFormat{LaTeX2e}[1999/12/01] |
| 23 |
\ProvidesPackage{emptypage} |
| 24 |
[2010/05/30 v1.2 Suppress page numbers and headings on empty pages] |
| 25 |
%</package> |
| 26 |
% |
| 27 |
%<*driver> |
| 28 |
\documentclass{ltxdoc} |
| 29 |
\usepackage{emptypage}[2010/05/30] |
| 30 |
\begin{document} |
| 31 |
\DocInput{emptypage.dtx} |
| 32 |
\end{document} |
| 33 |
%</driver> |
| 34 |
% \fi |
| 35 |
% |
| 36 |
% \CheckSum{33} |
| 37 |
% |
| 38 |
% \CharacterTable |
| 39 |
% {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 |
| 40 |
% 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 |
| 41 |
% Digits \0\1\2\3\4\5\6\7\8\9 |
| 42 |
% Exclamation \! Double quote \" Hash (number) \# |
| 43 |
% Dollar \$ Percent \% Ampersand \& |
| 44 |
% Acute accent \' Left paren \( Right paren \) |
| 45 |
% Asterisk \* Plus \+ Comma \, |
| 46 |
% Minus \- Point \. Solidus \/ |
| 47 |
% Colon \: Semicolon \; Less than \< |
| 48 |
% Equals \= Greater than \> Question mark \? |
| 49 |
% Commercial at \@ Left bracket \[ Backslash \\ |
| 50 |
% Right bracket \] Circumflex \^ Underscore \_ |
| 51 |
% Grave accent \` Left brace \{ Vertical bar \| |
| 52 |
% Right brace \} Tilde \~} |
| 53 |
% |
| 54 |
% \GetFileInfo{emptypage.sty} |
| 55 |
% |
| 56 |
% \title{The \textsf{emptypage} package\thanks{This document |
| 57 |
% corresponds to \textsf{emptypage}~\fileversion, dated \filedate.}} |
| 58 |
% \author{Karl Wette} |
| 59 |
% |
| 60 |
% \maketitle |
| 61 |
% |
| 62 |
% This package suppresses page numbers and headings from appearing |
| 63 |
% on empty pages. The code for doing this is not mine and already |
| 64 |
% exists in various places; all I've done is create a convenient |
| 65 |
% stand-alone package for it. |
| 66 |
% |
| 67 |
% \section{Usage} |
| 68 |
% |
| 69 |
% Just include the package! |
| 70 |
% |
| 71 |
% \section{Package options} |
| 72 |
% |
| 73 |
% \begin{description} |
| 74 |
% \item[odd] (default) The next non-empty page will be an odd-numbered page. |
| 75 |
% \item[even] The next non-empty page will be an even-numbered page. |
| 76 |
% \end{description} |
| 77 |
% |
| 78 |
% \StopEventually{} |
| 79 |
% |
| 80 |
% \section{Implementation} |
| 81 |
% |
| 82 |
% Create an empty page: |
| 83 |
% \begin{macrocode} |
| 84 |
\def\emptypage@emptypage{% |
| 85 |
\hbox{}% |
| 86 |
\thispagestyle{empty}% |
| 87 |
\newpage% |
| 88 |
\if@twocolumn% |
| 89 |
\hbox{}% |
| 90 |
\newpage% |
| 91 |
\fi% |
| 92 |
} |
| 93 |
% \end{macrocode} |
| 94 |
% |
| 95 |
% Implement \textbf{odd}: |
| 96 |
% \begin{macrocode} |
| 97 |
\DeclareOption{odd}{ |
| 98 |
\def\cleardoublepage{% |
| 99 |
\clearpage% |
| 100 |
\if@twoside% |
| 101 |
\ifodd\c@page% |
| 102 |
% do nothing |
| 103 |
\else% |
| 104 |
\emptypage@emptypage% |
| 105 |
\fi% |
| 106 |
\fi% |
| 107 |
} |
| 108 |
} |
| 109 |
% \end{macrocode} |
| 110 |
% |
| 111 |
% Implement \textbf{even}: |
| 112 |
% \begin{macrocode} |
| 113 |
\DeclareOption{even}{ |
| 114 |
\def\cleardoublepage{% |
| 115 |
\clearpage% |
| 116 |
\if@twoside% |
| 117 |
\ifodd\c@page% |
| 118 |
\emptypage@emptypage% |
| 119 |
\else% |
| 120 |
% do nothing |
| 121 |
\fi% |
| 122 |
\fi% |
| 123 |
} |
| 124 |
} |
| 125 |
% \end{macrocode} |
| 126 |
% |
| 127 |
% Default to \textbf{odd}: |
| 128 |
% \begin{macrocode} |
| 129 |
\ExecuteOptions{odd} |
| 130 |
% \end{macrocode} |
| 131 |
% |
| 132 |
% Process options: |
| 133 |
% \begin{macrocode} |
| 134 |
\ProcessOptions |
| 135 |
% \end{macrocode} |
| 136 |
% |
| 137 |
% \Finale |
| 138 |
\endinput |