%%
%% This is file `draftdoc.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% draftdoc.dtx  (with options: `draftdoc,dvips')
%% You are permitted to use, copy, distribute and modify this package
%% under the following conditions:
%%  * This and other copyright notices must be left intact.
%%  * You must distribute both ``draftdoc.dtx'' and ``draftdoc.ins''.
%%  * If you modify any file, you *must* change the file name and
%%    document the changes.
%%  * You may not charge for it in any way, shape or form.
%% If you use this and like it, please send an e-mail note to <bert@mit.edu>.
%% $Id: draftdoc.dtx,v 1.1 1998/02/20 02:50:20 bert Exp bert $
%%
\NeedsTeXFormat{LaTeX2e}

\ProvidesPackage{draftdoc}[1998/02/14 v0.10b <bert@mit.edu>]
\newcommand\dr@fttext{Draft}
\newcommand\drafttext[1]{\def\dr@fttext{#1}}
\newcommand\dr@ftshow{}
\DeclareOption{outline}%
  {\draftgray{.85}\def\dr@ftshow{false charpath stroke}}
\DeclareOption{fill}%
  {\draftgray{.95}\def\dr@ftshow{show}}
\newcommand\dr@ftfont{}
\newcommand\draftfont[1]{\def\dr@ftfont{#1}}
\DeclareOption{times}{\draftfont{Times-Roman}}
\DeclareOption{times-italic}{\draftfont{Times-Italic}}
\DeclareOption{helvetica}{\draftfont{Helvetica}}
\DeclareOption{helvetica-bold}{\draftfont{Helvetica-Bold}}
\DeclareOption{ncs}{\draftfont{NewCenturySchlbk}}
\newcommand\dr@ftangle{0}
\newcommand\draftangle[1]{\def\dr@ftangle{#1}}
\DeclareOption{45deg}{\draftangle{45}}
\DeclareOption{diagonal}{\draftangle{vsize hsize atan}}
\newcommand\dr@ftscaling{100}
\newcommand\draftscaling[1]{\def\dr@ftscaling{#1}}
\newcommand\dr@ftgray{0.9}
\newcommand\draftgray[1]{\def\dr@ftgray{#1}}
\newcommand\dr@ftmargins{18}
\newcommand\draftmargins[1]{\def\dr@ftmargins{#1}}
\DeclareOption{wide}{\draftmargins{18}}
\DeclareOption{narrow}{\draftmargins{72}}
\newcommand\dr@fttwoside{}
\DeclareOption{twoside}%
  {\def\dr@fttwoside{page-parity mul exch}}
\DeclareOption{noflip}%
  {\def\dr@fttwoside{}}
\def\draft@noopt#1,{\PackageError{draftdoc}%
  {Unknown option `\CurrentOption'}%
  {You specified `\CurrentOption' as a local option to the `draftdoc'
   package.\MessageBreak This option isn't declared; did you spell its
   name right?\MessageBreak You can try typing \space <return> \space
   to ignore this option and continue.}}
\def\draft@novalue,{\PackageError{draftdoc}%
  {Missing value for option `\CurrentOption'}%
  {You specified `\CurrentOption' as a local option to the `draftdoc'
   package.\MessageBreak This option requires an argument, as in
   `\CurrentOption=<some data>'.\MessageBreak You can try typing \space
   <return> \space to ignore this option and continue.}}
\def\draft@assign#1={%
\@ifundefined{draft#1}{\draft@noopt}{\draft@checkarg{draft#1}}}
\def\draft@checkarg#1{\@ifnextchar,{\draft@novalue}{\draft@set{#1}}}
\def\draft@set#1#2=,{\@nameuse{#1}{#2}}
\DeclareOption*{\expandafter\draft@assign\CurrentOption=,}
\ExecuteOptions{times,wide,diagonal,fill,noflip}
\ProcessOptions\relax
\AtBeginDocument{\begingroup \def\ { }\dr@ftspecial\endgroup}
\def\dr@ftspecial{%
  \special{!%
    userdict /bop-hook {
    gsave \dr@ftgray\ setgray hsize 2 div vsize 2 div translate
    dup 2 mod 2 mul 1 exch sub /page-parity exch def
    /\dr@ftfont\ findfont \dr@ftscaling\ scalefont setfont
    newpath 0 0 moveto (\dr@fttext) false charpath pathbbox newpath
    4 copy
    3 -1 roll sub 3 1 roll sub neg exch
    2 copy
    exch atan neg dup
    \dr@ftangle\ add
    cos exch cos div
    hsize \dr@ftmargins\ 2 mul sub exch div
    3 -1 roll div exch pop
    dup \dr@fttwoside\ scale
    \dr@ftangle\ rotate
    3 -1 roll add -2 div 3 1 roll add -2 div exch moveto
    (\dr@fttext) \dr@ftshow\
    grestore} put}}
\endinput
%%
%% End of file `draftdoc.sty'.
