%\iffalse -*- doctex -*- \fi
%
%% \RCS$Id: pmn-drft.sty,v 1.15 2004/03/21 22:03:26 turtle Exp $
%% \RCS$Revision: 1.15 $
%% \RCS$Date: 2004/03/21 22:03:26 $
%
%\iffalse metacomment
% -*- swiftex-dtx -*-
%%  $Id: pmn-drft.sty,v 1.15 2004/03/21 22:03:26 turtle Exp $
%%  (C) 2003 Peter Møller Neergaard
%% 
%%  This program may be distributed and/or modified under the
%%  conditions of the LaTeX Project Public License, either version 1.2
%%  of this license or (at your option) any later version.
%%  The latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%%  and version 1.2 or later is part of all distributions of LaTeX 
%%  version 1999/12/01 or later.
%
% This program consists of the file pmn-drft.sty.
% 
% To print the documentation (which for the moment is uninteresting)
% remove you will have to uncomment all the lines starting with %D%.
% 
%\fi
%
% \CheckSum{18} 
% \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         \~}
%
% \MakeShortVerb{\"}
%
% \title{The \package{pmn-drft} package\thanks
%   {This file has CVS revision \RCSRevision, dated \RCSDate.}}
% \author{Peter Møller Neergaard}
% \maketitle
%
% \begin{abstract}
%   Aids in making draft of conference papers.  
% \end{abstract}
%
% This package helps making drafts of conference and journal pages.
% When the option "draft" is given it allows the following to take
% effect.
% \begin{itemize}
% \item With the "pageno" option page numbers are added.
% \item With the "overfullboxes" option overfull boxes are marked in the
% output
% \item A draft marker is added to the page.  This can be disabled with
% the option "nodraftmark"
% \end{itemize}
%
% First we handle the options
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pmn-drft}[2004/03/12 v0.2 pmn-drft]
\DeclareOption{draft}{\Drafttrue}
\DeclareOption{pageno}{\PMNpagenotrue}
\DeclareOption{nodraftmark}{\PMNMarkDraftfalse}
\DeclareOption{overfullboxes}{\PMNBoxestrue}
%    \end{macrocode}
% \changes{0.2}{2004/03/12}{made draftmark default in option \texttt{draft}.}
% \changes{v0.2}{2004/03/16}{draft options are only enabled when draft is enabled.}
% Provides a draft mode to mark that  the manuscript is still only
% a draft. 
%    \begin{macrocode}
\newif\ifPMNBoxes
\newif\ifDraft\Draftfalse
\newif\ifPMNMarkDraft
\PMNMarkDrafttrue
\newif\ifPMNpageno
\def\ifFinal{%
  \ifDraft
     \@firstoftwo\expandafter
  \else
     \@secondoftwo\expandafter
  \fi
  {\iffalse}{\iftrue}}
%    \end{macrocode}
%  
% \changes{0.2}{2004/03/12}{made \cs{ifFinal} a true \TeX-conditional.}
%    \begin{macrocode}
\ProcessOptions
%    \end{macrocode}
% In draft mode we mark overfull boxes
%    \begin{macrocode}
\AtBeginDocument{\ifDraft\ifPMNBoxes\overfullrule=5pt\fi\fi}
%    \end{macrocode}
% And we mark the manuscript as draft on each page
%    \begin{macrocode}
\AtBeginDocument{%
  \ifDraft
    \ifPMNMarkDraft
    \else
       \draftcopyLastPage{0}%  
    \fi
   \else
     \draftcopyLastPage{0}%
   \fi}
\RequirePackage[timestamp,all,light,dvips]{draftcopy}
%    \end{macrocode}
% In draft mode we add a page number at the bottom
%    \begin{macrocode}
\ifDraft\ifPMNpageno
  \RequirePackage[draft]{prelim2e}
  \renewcommand{\PrelimText}{\bfseries - \the\count0\ -}
\fi\fi
%    \end{macrocode}
% \StopEventually
%
% And the commands to typeset the documentation.  All enclosed in
% "<*documentation>"$\ldots$"</documentation>" so we exclude it if we
% ever make a \package{docstrip} file.  For now, we simply stop input with
% \cmd{\endinput} so the file can be used directly as a package file.
%    \begin{macrocode}
%<*documentation>
%    \end{macrocode}
%  First we need to disable the \cmd{\part} command 
%    \begin{macrocode}
\endinput
\makeatletter
\let\part\@undefined
\let\section\@undefined
\makeatother
\documentclass{pmn-ldoc} 
\newcommand{\docdate}{2003/11/02}
\usepackage[latin1]{inputenc}
 % \OnlyDescription
 % \DisableCrossrefs
\begin{document}
  \DocInput{pmn-drft.sty}
\end{document}
%</documentation>
%    \end{macrocode}
% \Finale \sloppy \PrintChanges
