% \iffalse
% File pageno.dtx
% inspired by Axel Sommerfeldt's rplain.sty
% Copyright Rowland McDonnell 1996
% Some code copyright Axel Sommerfeldt
% email: rebecca@astrid.u-net.com
% 
% See the section on copying below for restrictions.
% 
%\fi
%
%\iffalse
%<*driver>
\documentclass[a4paper]{ltxdoc}
\begin{document}
 \DocInput{pageno.dtx}
\end{document}
%</driver>
%\fi
%\iffalse
%<*package>
%\fi
%%
%% \CheckSum{189}
%% \CharacterTable
%%  {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
%%   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
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%
%
%\iffalse
% Some useful bits
%\fi
% \newcommand*{\bs}{\char'134}
% \DeclareRobustCommand*{\packname}[1]{\textsf{#1}}
% \DeclareRobustCommand*{\comname}[1]{{\ttfamily\makeatletter\bs #1\makeatother}}
% \newcommand*{\optname}[1]{{\ttfamily #1}}
% \newcommand*{\filename}[1]{{\ttfamily #1}}
% 
% \title{The \packname{pageno} package}
% \date{Version 1.2, 22nd September 1998}
% \author{ Rowland McDonnell,\\ after Axel Sommerfeldt}
% \maketitle
% \tableofcontents
%
% \section{Introduction}
% 
% The \packname{pageno} package can change the place that page 
% numbers are printed on the page.  By page numbers, I mean `folios': 
% the numbers printed on a page to say which page it is.
% 
% This job is done by re-defining the \texttt{plain} page style; you 
% control where the page numbers are printed by passing options to the 
% \packname{pageno} package. You can have page numbers at the top or 
% bottom of the page; in the inside corner, outside corner, or in the 
% middle.
% 
% The advantage of this way of doing things over the \packname{fancyhdr} 
% package is that you don't have to worry about your new page style 
% being `lost' because some part of \LaTeX{} has switched to the 
% \texttt{plain} page style, and of course there are no new commands to 
% learn.  The disadvantage is that it's a very simple-minded package: 
% any package that re-defines the \texttt{plain} page style is likely 
% to conflict in some way with \packname{pageno}.  In such cases, the 
% \packname{fancyhdr} package might well help.
% 
% If you want more control over headers and footers, or if you don't 
% want to re-define the \texttt{plain} page style, try the 
% \packname{fancyhdr} package.
%
% The \packname{pageno} package was inspired by Axel Sommerfeldt's 
% \packname{rplain} package, which redefines the \texttt{plain} page 
% style to put page numbers in the bottom outside corner.
%
% \section{How to use the package}
% 
% It's all done with options:
% \begin{verbatim}
% \documentclass{article}
% \usepackage[insidefoot]{pageno}
% \begin{document}
% ...
%\end{verbatim}
% will re-define the \texttt{plain} page style so that page numbers will 
% be printed in the bottom inside corner. If you don't give the 
% \packname{pageno} package an option, it won't change the 
% \texttt{plain} page style.  If you give \packname{pageno} more than 
% one option, the last one specified will be the one that's used.
% 
% Whatever else \packname{pageno} does, it will switch to the 
% \texttt{plain} page style when its finished.
% 
% The full list of options is this:
%\DeleteShortVerb{\|}
% \begin{center}
% \begin{tabular}{l|l}
% Option                & Page number position \\ \hline
% \optname{centerfoot}  &  Centre bottom  \\
% \optname{outsidefoot} &  Outside bottom \\
% \optname{insidefoot}  &  Inside bottom  \\
% \optname{centrehead}  &  Centre top     \\
% \optname{outsidehead} &  Outside top    \\
% \optname{insidehead}  &  Inside top     \\
% \end{tabular}
% \end{center}
% \MakeShortVerb{\|}
% You can say \optname{centrefoot} and \optname{centrehead} instead 
% of \optname{centerfoot} and \optname{centerhead} if you like.
% 
% The \optname{centerfoot} option really does re-define the 
% \texttt{plain} pagestyle, but it's redundant because the result is 
% the same as the default definition.
%
% If you use this package, or decide not to, I'd very much appreciate it 
% if you would send me a message saying why. Suggestions for 
% improvements and reports of bugs are of course most welcome. 
% \verb|rebecca@astrid.u-net.com| is my email address.
% 
% \section{A typographical note}
% 
% There is a point to labeling each page in a document with a page 
% number: it's so the reader can refer to it.  In a conventional book, 
% the best place for the page number is on one of the outside edges: 
% that way, a reader can flip through the book and find a page easily.  
% If the page numbers are on an inside edge, it's very difficult to 
% read them without fully opening the book on each page.
%
% \section{Copying and stuff}
%
% If you want to give the \packname{pageno} package to someone, please 
% give them the unchanged files \filename{pageno.dtx} and 
% \filename{pageno.ins}. Anyone may make as many copies of these files 
% as they like and give them to anyone. You're not allowed to charge 
% money for distributing this package, except for a nominal fee to cover 
% costs, although I'm happy for non-profit organizations like the TeX 
% Users' Group to include and sell this on CD-ROMs and the like 
% containing selections of code from CTAN.
%
% If you want to change this package, please make a copy of the package 
% file, and change the name, file identification commands, and comments 
% to identify it as being your responsibility now, not mine.
% 
% \StopEventually
%
%\iffalse
% 1998/09/22 v1.3 Re-wrote some documentation with the aim of 
%     uploading it to CTAN
% 1996/11/01 v1.2 It looks ready now
%\fi
% \section{The code itself}
%
% Who am I, and what do I need?  This package will probably work with 
% any version of \LaTeXe, but I've only tested it with the June 1996 
% release.
%
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1996/06/01]
\ProvidesPackage{pageno}[1996/11/01 v1.2
	pagenumbers package (RJMM, after AS)]
%    \end{macrocode}
%
% \subsection{Declare and process the options}
%
% There's not much to be said, really.  The \optname{centrefoot} option 
% duplicates the effect of the standard definition of 
% \comname{ps@plain}---this is the macro that is executed to define the 
% \texttt{plain} page style.  The other options are variations on the 
% same theme.  Axel Sommerfeldt did the original re-definition; I copied 
% him.  The original \LaTeX{} code looks like this:
% \begin{verbatim}
% \def\ps@plain{\let\@mkboth\@gobbletwo
%      \let\@oddhead\@empty\def\@oddfoot{\reset@font\hfil\thepage
%      \hfil}\let\@evenhead\@empty\let\@evenfoot\@oddfoot}
%\end{verbatim}
%
% The redefinitions here might be a little less efficient than the 
% standard code, but I doubt that matters.
%
%    \begin{macrocode}
\DeclareOption{centrefoot}{%
	\renewcommand{\ps@plain}{%
	   \renewcommand{\@mkboth}{\@gobbletwo}%
	   \renewcommand{\@oddhead}{}%
	   \renewcommand{\@evenhead}{}%
	   \renewcommand{\@evenfoot}{\reset@font\rmfamily\hfil\thepage\hfil}%
	   \renewcommand{\@oddfoot}{\reset@font\rmfamily\hfil\thepage\hfil}}
	}
	
\DeclareOption{centerfoot}{%
	\renewcommand{\ps@plain}{%
	   \renewcommand{\@mkboth}{\@gobbletwo}%
	   \renewcommand{\@oddhead}{}%
	   \renewcommand{\@evenhead}{}%
	   \renewcommand{\@evenfoot}{\reset@font\rmfamily\hfil\thepage\hfil}%
	   \renewcommand{\@oddfoot}{\reset@font\rmfamily\hfil\thepage\hfil}}
	}

\DeclareOption{outsidefoot}{%
	\renewcommand{\ps@plain}{%
	   \renewcommand{\@mkboth}{\@gobbletwo}%
	   \renewcommand{\@oddhead}{}%
	   \renewcommand{\@evenhead}{}%
	   \renewcommand{\@evenfoot}{\reset@font\rmfamily\thepage\hfil}%
	   \renewcommand{\@oddfoot}{\reset@font\rmfamily\hfil\thepage}}
	}

\DeclareOption{insidefoot}{%
	\renewcommand{\ps@plain}{%
	   \renewcommand{\@mkboth}{\@gobbletwo}%
	   \renewcommand{\@oddhead}{}%
	   \renewcommand{\@evenhead}{}%
	   \renewcommand{\@evenfoot}{\reset@font\rmfamily\hfil\thepage}%
	   \renewcommand{\@oddfoot}{\reset@font\rmfamily\thepage\hfil}}
	}

\DeclareOption{centrehead}{%
	\renewcommand{\ps@plain}{%
	   \renewcommand{\@mkboth}{\@gobbletwo}%
	   \renewcommand{\@evenhead}{\reset@font\rmfamily\hfil\thepage\hfil}%
	   \renewcommand{\@oddhead}{\reset@font\rmfamily\hfil\thepage\hfil}%
	   \renewcommand{\@evenfoot}{}%
	   \renewcommand{\@oddfoot}{}}
	}

\DeclareOption{centerhead}{%
	\renewcommand{\ps@plain}{%
	   \renewcommand{\@mkboth}{\@gobbletwo}%
	   \renewcommand{\@evenhead}{\reset@font\rmfamily\hfil\thepage\hfil}%
	   \renewcommand{\@oddhead}{\reset@font\rmfamily\hfil\thepage\hfil}%
	   \renewcommand{\@evenfoot}{}%
	   \renewcommand{\@oddfoot}{}}
	}

\DeclareOption{outsidehead}{%
	\renewcommand{\ps@plain}{%
	   \renewcommand{\@mkboth}{\@gobbletwo}%
	   \renewcommand{\@evenhead}{\reset@font\rmfamily\thepage\hfil}%
	   \renewcommand{\@oddhead}{\reset@font\rmfamily\hfil\thepage}%
	   \renewcommand{\@evenfoot}{}%
	   \renewcommand{\@oddfoot}{}}
	}

\DeclareOption{insidehead}{%
	\renewcommand{\ps@plain}{%
	   \renewcommand{\@mkboth}{\@gobbletwo}%
	   \renewcommand{\@evenhead}{\reset@font\rmfamily\hfil\thepage}%
	   \renewcommand{\@oddhead}{\reset@font\rmfamily\thepage\hfil}%
	   \renewcommand{\@evenfoot}{}%
	   \renewcommand{\@oddfoot}{}}
	}

\ProcessOptions*
%    \end{macrocode}
%
% \subsection{Select the \texttt{plain} page style and finish}
%
%    \begin{macrocode}
\pagestyle{plain}
\endinput
%    \end{macrocode}
%
% \Finale
%\iffalse
%<*package>
%% 
%% End of file `pageno.dtx'.\fi