% DRAFTSTAMP.sty
%
%   Put a big DRAFT (or anything) across each page (or only the first page),
% using PostScript.
%
% USAGE
%   Bring it in with 
%     \input draftstamp.sty
% (LaTeX users can instead say \documentstyle[...,draftstamp,...]{...}).  
% The default it to print DRAFT without the user doing anything. 
%
% RESTRICTIONS
%   1) Expects the DVI to PostScript driver to be DVIPS.
%
% REMARKS
%   1) The angle, position, font, and typesize can be changed inside each 
%    document if you comment out the \draftstamp just up from the bottom of
%    this file.  The price is that you have to say \draftstamp yourself,
%    after you (optionally) redefine these values (obviously at the
%    start of the document).  Example: for LaTeX, the line after
%      \documentstyle[..,draftstamp,..]{..}
%    could read 
%      \def\drafttext{INTERNAL ONLY}\def\draftPSscalefont{ 100 }\draftstamp
%    (note the \draftstamp).  See also Installation (3).
%   2) The number before setgray describes lightness or darkness of the text.
%    This is white area/total area, so white=1, black=0.
%   3) Called draftstamp.sty and not draftstamp.tex (i) so LaTeX users can
%    include it in the list of substyles, if desired, and (ii) so a person
%    on the nets can tell from the directory listing alone that it is
%    a drop-in file, and not a document.
%
% INSTALLATION
%   0) Put this where your TeX looks for files.  For emTeX that is probably
%    c:\emtex\texinputs.
%   1) Run as described in Usage and check the darkness of DRAFT.  Tip: check
%    if it reproduces on your favorite copier.  See Remark (2).
%   2) Have the next line be uncommented if you want a warning when the 
%    stamp is on.
\message{   Substyle DRAFTSTAMP <93-Jul-07 jh>.}
%   3)  Some people may want DRAFT only on the first page.  Or they may want
%    some other text. They need to change this file (or, if this file is in 
%    an inaccessable shared area, change a copy of this file in their home 
%    area).
%       Here are their options.
%       (i) Go to the bottom.  
%           Change the commenting so that \draftfirstpageonlytrue is the 
%         default.  Now every document will put DRAFT on only the first page.
%           Or, change \drafttext to \def\drafttext{v. 1.01}.  Now every
%         document will have v. 1.01 on the pages.  Of course, non-English
%         documents will need something like this.
%           Or, change any default in this way.
%       (ii) To decide values on a per-document basis, go to the bottom and 
%          comment out the \draftstamp invocation.  Inside eacy document,
%          any changes made to the defaults must be followed by \draftstamp: 
%          for instance, DRAFT only on the first page with
%             \draftfirstpageonlytrue\draftstamp  
%          (naturally you can, for instance, combine the \input draftstamp.sty 
%          line and the above into a personal macro).
%        (iii) Modify this file to either prompt the user or to look for a 
%          user's (configuration or profile) file to set defaults on a 
%          per-user basis. I (jh) thought these were both big solutions to 
%          a small problem, so I didn't do them.
%
% HISTORY
%   93-Jul-07 jh Lones Smith (lones@lones.mit.edu) suggests an option for 
%     printing only on the first page.  I made some internal changes so 
%     that could be done at document-processing time, instead of set
%     by a system manager.
%   93-Jul-01 jh Added Installation (1) tip.  Posted to SHSU.
%   93-May-18 jh Changed setgray number from .99 to .94 to make DRAFT darker
%     so it will reproduce on my copier.
%   93-Mar-05 jim hefferon (hefferon@smcvax.smcvt.edu)  Typed in from an note
%     given by Vivek Khera (khera@cs.duke.edu) on comp.text.tex, who said it
%     came first from Anita Marie Hoover (anita@brahms.udel.edu).  ?Derives 
%     first from the dvips manual?
%
% macro: \draftstamp  Insert raw PostScript via a dvips \special.
%    The dvips manual under Other Bells and Whistles suggests printing a DRAFT
% across each page with essentially:  
%    \special{! userdict 
%       begin /bop-hook{
%         gsave 200 30 translate
%         65 rotate /Times-Roman findfont 220 scalefont setfont
%         0 0 moveto 0.94 setgray (DRAFT) show grestore
%       }def end}}%
% (`bop-hook' for  `beginning of page'?).  I (jh) turned these numbers
% into variables and buried it inside a \def\draftstamp so the numbers are 
% set when the \draftstamp command is issued, instead of when this file is 
% read.
\newif\ifdraftfirstpageonly
%    Now either \draftfirstpageonlytrue or \draftfirstpageonlyfalse
% puts DRAFT only on the first page, or on every page.  Omitting both
% amounts to `false'.  See the discussion of \newif (p. 211 in TeXbook).
% (I (jh) chose \newif instead of an optional argument so plain TeX works,
% not just LaTeX.) 
\def\draftstamphook{\ifdraftfirstpageonly/start%
                    \else/bop%
                    \fi}
\def\draftstamp{\special{! userdict 
       begin \draftstamphook-hook{
         gsave \draftPStranslate translate
         \draftPSrotate rotate \draftPSfont findfont 
         \draftPSscalefont scalefont setfont
         \draftPSmoveto moveto \draftPSgraylevel setgray 
         (\drafttext) show grestore
       }def end}}%
%
% DEFAULTS
\def\drafttext{DRAFT}
\def\draftPStranslate{ 200 30 }
\def\draftPSscalefont{ 220 }
\def\draftPSgraylevel{ 0.94 } % See Remarks (2) and Installation (1).
\def\draftPSrotate{ 65 }
\def\draftPSmoveto{ 0 0 }
\def\draftPSfont{ /Times-Roman }
%   Comment out whichever of these you don't want to make the default.
\draftfirstpageonlyfalse    % do all pages
%\draftfirstpageonlytrue    % do first page only
%
%   The next command activates \draftstamp. If you want to activate 
% differently for each document (say, by sometimes changing DRAFT to
% SECRET) you  need to comment this line out.  (It 
% is here for compatibility with old versions of this style.)  See also 
% Installation (3).
\draftstamp

\endinput
