%
%****************************** Copyright Notice *******************************
%                                                                              *
%  Copyright (c) 1996 Universities Research Association, Inc.                  *
%                All Rights Reserved.                                          *
%                                                                              *
%*******************************************************************************
%
%********************************************************************
%********************************************************************
%****								 ****
%****								 ****
%****	             Fermilab Magnet Test Facility (MTF)         ****
%****								 ****
%****                Software Facility: MTF LaTeX                ****
%****								 ****
%****								 ****
%********************************************************************
%********************************************************************
%
%+ LocalNote.sty
%
% ABSTRACT:	The Fermilab MTF document style modifications for article.sty
%               (mtfarticle.sty) have been modified for use in producing
%               documents for other Fermilab note series.  The logo produced
%               is simply the Fermilab logo with word 'Fermilab' rather than
%               'Fermilab MTF'.
%               The following features are defined:  
%               \maketitle  is redefined to eliminate \newpage before title.
%		\mtfdocnvc  creates header with logo, number, version, category
%		\mtfdocnv   creates header with logo, number, version
%               \sigbox     creates a signature line with labels
%               \apphd, \apprv together create and label management-based
%                           approval signature lines
%               \mtfhead    creates a head for following pages
%		\fermilogo  Tom Nicinski code - see end of file
%               \pgph       is a command to create a paragraph indentation
%                               at the beginning of sections 
%
% Environment:	LaTeX style file for use with LaTeX 2e article.cls
%
% Related Software:	
%
% MTF Document Cross References: MTF-92-0002  Preparing MTF LaTeX Documents
%
% Modification History:
% Version	Author	Date		Description of modification
%  1.0 		BCBrown	30-Jun-1992     Initial entry.
%              Deficiencies noted:  	not tested on two column documents
%  1.2 		BCBrown	19-Nov-1992     Added Date to the sigbox command
%  1.3          BCBrown 06-Sep-1994     Added \apphd, \apprv commands
%  2.0          BCBrown 10-Jul-2003     Rename to LocalNote.sty
%                                       Replaced maketitle portion of fermiarticle.sty
%                                       with extensive part of article.cls, commenting
%                                       out the \newpage commands to permit logo at top.
%-
%******************************************************************************
%******************************************************************************
% 
% \fermilogo{size}{text}
%
% Display the Fermilab logo along with any optional text.  In general, the fol-
% lowing is nice:
%
%	\fermilogo{0.5in}{\huge\sf Fermilab}
%
% \mtfdocnvc{docnum}{docver}{doccategory}
% \mtfdocnv{docnum}{docver}
%
% Create a Fermilogo and box with Document number, version, (and category) info
% The following is suitable for specifying the information in the text.
% An alternative exists for including version information from SCCS source
% code management system, but that cannot easily be shown here....
%
%       \mtfdocnvc{MTF-92-0001}{V2.3}{SPECIFICATION}
%
% When no category is to be specified, use instead
%
%       \mtfdocnv{MTF-92-0001}{V2.3}
%
% The above commands should also use the commands \mtfdocnum and \mtfdocver 
% discussed below under \mtfheader
%
% To create a signature box with approval type header above 
%    and approving person identifier and space for date below use
%
% \sigbox{width}{vspace}{header}{identifier}
%
% A more complex example places two signatures across a page:
% \makebox[\textwidth]{\sigbox{1.5in}{1em}{Designed by}{Designworker} \hfill 
%         \sigbox{1.5in}{1em}{Authorized by}{Grand Wizard}}
%
% For approvals based on management roles, the commands \apphd and \apprv
% create a header and boxes.  Alignment can be affected by paragraph
% indentation so care should be exercised.  Label in \apprv is in a 
% framebox so one can use \\ to make line breaks for the label.
%
% \apprv{label}{height}
%
% A header for pages can be created using 
% the myheader pagestyle with the command
% mtfhead.  It assumes that the commands \mtfdocnum and \mtfdocver are defined 
% within the document.  For example, the following command uses \mtfhead
%
% \markboth{\mtfhead}{\mtfhead}
%
% examples of using the commands \mtfdocnum and \mtfdocver are 
% \newcommand{\mtfdocnum}{MTF-92-001}
% \newcommand{\mtfdocver}{V3.2}
% however, at MTF we expect to draw the version from 
% code management w/ SSCS commands
%

%\typeout{Document Style `fermiarticle V1.4' <14 Feb 96>.}
\typeout{Document Style `FermiLocalNote V2.0' <9 Jul 03>.}


\newcommand{\mtfdocnvc}[3]{\parbox{3in}
	{\fermilogo{0.5in}{\LARGE\sf Fermilab}}
          \hfill   \parbox{2in}{Doc Number:\hfill #1\\
Version:\hfill #2 \\Category:\hfill #3}}

\newcommand{\mtfdocnv}[2]{\parbox{3in}
	{\fermilogo{0.5in}{\LARGE\sf Fermilab}}
          \hfill  \parbox{2in}{Doc Number:\hfill #1 \\
Version:\hfill #2 }}

\newcommand{\mtfhead}{\mtfdocnum \hspace{2em} \mtfdocver\hfill\@date\hfill}

\newcommand{\sigbox}[4]{\parbox{#1}{\begin{center} #3 \end{center} 
\vspace{#2}\_\hrulefill \newline #4 \hfill Date} }

\newcommand{\pgph}{\makebox[\parindent][c]{}}

\newcommand{\apphd}{ \framebox[6in][l]{  \parbox{2in}{ \Large \center
    Title} \rule[-.1in]{0.005in}{.25in}
    \parbox{2in}{\Large \center Signature} \rule[-.1in]{0.005in}{.25in} 
    \parbox{2in}{\Large \center Date } }\\}

\newcommand{\apprv}[2]{\framebox[6in][l]{  \parbox{2in}{ \Large #1 } 
    \rule[-.3in]{0.005in}{#2}
    \parbox{2in}{\hfill} \rule[-,3in]{0.005in}{#2} \parbox{2in}{\hfill} } \\ }

% This portion imported from article.cls circa 2001 and modified to remove \newpage

  \if@titlepage
  \renewcommand\maketitle{\begin{titlepage}%
  \let\footnotesize\small
  \let\footnoterule\relax
  \let \footnote \thanks
  \null\vfil
  \vskip 60\p@
  \begin{center}%
    {\LARGE \@title \par}%
    \vskip 3em%
    {\large
     \lineskip .75em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
      \vskip 1.5em%
    {\large \@date \par}%       % Set date in \large size.
  \end{center}\par
  \@thanks
  \vfil\null
  \end{titlepage}%
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}
\else
\renewcommand\maketitle{\par
  \begingroup
    \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
    \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
    \long\def\@makefntext##1{\parindent 1em\noindent
            \hb@xt@1.8em{%
                \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
    \if@twocolumn
      \ifnum \col@number=\@ne
        \@maketitle
      \else
        \twocolumn[\@maketitle]%
      \fi
    \else
%      \newpage   %  remove this from code in original article.cls
      \global\@topnum\z@   % Prevents figures from going at top of page.
      \@maketitle
    \fi
    \thispagestyle{plain}\@thanks
  \endgroup
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}
\def\@maketitle{%
%  \newpage    %  remove this from code in original article.cls
  \null
  \vskip 2em%
  \begin{center}%
  \let \footnote \thanks
    {\LARGE \@title \par}%
    \vskip 1.5em%
    {\large
      \lineskip .5em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
    \vskip 1em%
    {\large \@date}%
  \end{center}%
  \par
  \vskip 1.5em}
\fi



%****************************** Copyright Notice *******************************
%                                                                              *
%  Copyright (c) 1991 Universities Research Association, Inc.                  *
%                All Rights Reserved.                                          *
%                                                                              *
%*******************************************************************************
%++
% FACILITY:	LaTeX
%
% ABSTRACT:	The Fermilab logo for documentation.
%
% ENVIRONMENT:	LaTeX source.  UNIX.
%		fermilogo.tex
%
% AUTHOR:	Tom Nicinski, Creation Date: 14-Feb-1991
%
% MODIFIED BY:
%
%	V01-001	THN		Tom Nicinski			14-Feb-1991
%		Initial entry.
%--
%*******************************************************************************
%
% \fermilogo{size}{text}
%
% Display the Fermilab logo along with any optional text.  In general, the fol-
% lowing is nice:
%
%	\fermilogo{0.5in}{\huge\sf Fermilab}
%
\newcommand{\fermilogo}[2]{%
\begingroup%
\dimen255=#1\divide\dimen255 by 140\relax%
\setlength{\unitlength}{\dimen255}%
\thicklines%
\begin{picture}(140, 140)(0, 0)
\put( 45, 140){\line (1, 0){20}}                                             
                   \put( 75, 140){\line (1, 0){20}}
\put( 45, 125){\line (0, 1){15}} \put( 65, 125){\line (0, 1){15}} \put ( 75, 
125){\line (0, 1){15}} \put( 95, 125){\line (0, 1){15}}
\put( 20, 125){\line (1, 0){25}}                   \put( 65, 125){\line (1, 
0){10}}                 \put( 95, 125){\line (1, 0){25}}
\put( 20, 105){\line (0, 1){20}}                                     
                   \put(120, 105){\line (0, 1){20}}
\put( 20, 105){\line (1, 0){25}}                   \put( 65, 105){\line (1, 
0){10}}                 \put( 95, 105){\line (1, 0){25}}

\put(  0,  95){\line (1, 0){35}} \put(34,  105){\oval (20,20)[br]}\put(105, 
105){\oval (20,20)[bl]} \put(105,  95){\line (1, 0){35}}
\put(  0,  75){\line (0, 1){20}}                                     
                   \put(140,  75){\line (0, 1){20}}
\put(  0,  75){\line (1, 0){35}} \put(34.5,105){\oval (60,60)[br]}\put(105, 
105){\oval (60,60)[bl]} \put(105,  75){\line (1, 0){35}}

\put(155,  70){\makebox (0, 0)[l]{#2}}

\put(  0,  65){\line (1, 0){35}} \put(34.5, 35){\oval (60,60)[tr]}\put(105,  
35){\oval (60,60)[tl]} \put(105,  65){\line (1, 0){35}}
\put(  0,  45){\line (0, 1){20}}                                   
                   \put(140,  45){\line (0, 1){20}}
\put(  0,  45){\line (1, 0){35}} \put(34,   35){\oval (20,20)[tr]}\put(105,  
35){\oval (20,20)[tl]} \put(105,  45){\line (1, 0){35}}

\put( 20,  35){\line (1, 0){25}}                   \put( 65,  35){\line (1, 
0){10}}                 \put( 95,  35){\line (1, 0){25}}
\put( 20,  15){\line (0, 1){20}}                                    
                   \put(120,  15){\line (0, 1){20}}
\put( 20,  15){\line (1, 0){25}}                   \put( 65,  15){\line (1, 
0){10}}                 \put( 95,  15){\line (1, 0){25}}
\put( 45,   0){\line (0, 1){15}} \put( 65,   0){\line (0, 1){15}} \put ( 75,   
0){\line (0, 1){15}} \put( 95,   0){\line (0, 1){15}}
\put( 45,   0){\line (1, 0){20}}                                       
                   \put( 75,   0){\line (1, 0){20}}
\end{picture}%
\endgroup%
}
%
%*******************************************************************************
