%^^A* copyright
% \iffalse
%
%   This program is part of the Frankenstein bundle for LaTeX2e.
%
%   Copyright (C) 1995, 1996 Matt Swift <swift@bu.edu>
%
%   This program is free software; you can redistribute it and/or modify
%   it under the terms of the GNU General Public License as published by
%   the Free Software Foundation; either version 2 of the License, or
%   (at your option) any later version.
%
%   This program is distributed in the hope that it will be useful,
%   but WITHOUT ANY WARRANTY; without even the implied warranty of
%   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%   GNU General Public License for more details.
%
%   You should have received a copy of the GNU General Public License
%   along with this program; if not, write to the Free Software
%   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%
%      NOTE:  I am willing to specially license this code.
%             Please simply contact me with your proposal.
%
%^^A   NOTE:  \DocInput will start reading after this \fi:
% \fi  
%
%^^A* checks
%
%^^A NOTE:  The character table, with two %'s, will get written to all files.
%% \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         \~}
%
% \CheckSum{602} 
%
%^^A** abstract
% \begin{abstract}
%  FIX
% \end{abstract}
%
% \part{Discussion}
%
% \StopEventually{}
%
% \part{Implementation}
%
% \section{Version control}
%
%  \begin{macro}{\fileinfo}
%  \begin{macro}{\fileversion}
%  \begin{macro}{\filedate}
%  \begin{macro}{\docdate}
%  \begin{macro}{\PPOptArg}
% These definitions must be the first ones in the file.
%    \begin{macrocode}
\def\fileinfo{basic bits (Frankenstein's guts)}
\def\fileversion{v1.0}
\def\filedate{1996/03/26}
\def\docdate{1996/03/26}
\edef\PPOptArg {%
  \filedate\space \fileversion\space \fileinfo
}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
% Stop right here if we're just loading the file's information, and don't want
% to load this code for typesetting its documentation (only makes sense for
% certain packages).  The |JuStLaAdInFoRmAtIoN| flag will be set by the
% documentation driver; the |DoXNeeDME| flag will be set in the
% \ext{dtx} file, and will appear above if it's set.
%    \begin{macrocode}
\makeatletter
\@ifundefined{JuStLoAdInFoRmAtIoN} {%
  }{% ELSE
  \@ifundefined{DoXNeeDME} {%
    }{% ELSE
    \UndefineCS\JuStLoAdInFoRmAtIoN
    \usepackage{bits}%
  }
  \makeatother
  \endinput
}
%    \end{macrocode}
%
% Now we check for \LaTeX2e and declare the package.
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{bits}[\PPOptArg]
%    \end{macrocode}
%
% ^^A NOTE: We have to compensate for the above backslashes, which are not
% ^^A actually in the doctex file I work on.
%%
% \AddToCheckSum{26}
% 
% \makeatletter
%   \@ifundefined{DoXNeeDME} {} {\AddToCheckSum{2}}
% \makeatother
%
%
% \section{Preliminaries}
%
%   \subsection{Requirements}
%
%    \begin{macrocode}
\RequirePackage{blkcntrl,moredefs,relsize}
%    \end{macrocode}
%
%   \subsection{Option processing}
%
%    \begin{macrocode}
\DeclareOption{poetica} {%
  \RequirePackage{poetica}
  \newcommand\FullTitlePoetica {%
    \begin{Poetica}
      \fontshape{t}\selectfont
      \BitTitle\\%
      \ifx\BitSubtitle\ShortEmpty \else
        \BitSubtitle\\%
      \fi
    \end{Poetica}
  }
  \AtBeginDocument {%
    \let\FullTitle\FullTitlePoetica
  }
}
\DeclareBooleanOptions{ends}{noends}
\DeclareBooleanOptions{titlepage}{notitlepage}
\DeclareBooleanUserOptions{signed}{anonymous}
\ExecuteOptions{ends,notitlepage,signed}
\ProcessOptions
%    \end{macrocode}
%
% \section{Making new copy and bit styles}
%
%   \subsection{General stuff}
%
% \begin{macro}{\bt@a}
% \begin{macro}{\bt@b}
% \begin{macro}{\bt@c}
% \begin{macro}{\bt@d}
% \begin{macro}{\bt@e}
%   Notice these are local.
%    \begin{macrocode}
\ReserveCS\bt@a
\ReserveCS\bt@b
\ReserveCS\bt@c
\ReserveCS\bt@d
\ReserveCS\bt@e
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
% \begin{macro}{\if@bt@trymoreschemes@}
% \begin{macro}{\@bt@trymoreschemes@true}
% \begin{macro}{\@bt@trymoreschemes@false}
% \begin{macro}{\sc@scheme@components}
% \begin{macro}{\sc@listcar}
% \begin{macro}{\sc@listcdr}
% \begin{macro}{\sc@bitstyle@list}
% \begin{macro}{\sc@copystyle@list}
%   Comma-separated lists of valid bitstyles, copystyles, and
%   scheme-components.  We start them off non-null because we have to bootstrap
%   the system of adding new ones.
%    \begin{macrocode}
\newcommand\sc@scheme@components {%
  environment,end@bit,begin@bit,interbits,firstbit%
  ,settitle,setfirsttitle%
}
\newcommand\sc@bitstyle@list {%
  generic%
}
\newcommand\sc@copystyle@list {%
  standard%
}
\provideboolean{@bt@trymoreschemes@}

\NewName{sc@listcar}{#1,#2\@nil} {%
  #1%
}
\NewName{sc@listcdr}{#1,#2\@nil} {%
  #2%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\NewCopystyle}
% \begin{macro}{\NewBitstyle}
% \begin{macro}{\sc@assign@scheme@component}
%   Each component of the new style is set to the corresopnding component of
%   the first scheme in the scheme-list for which defines such a component.  To
%   be safe, every scheme-list should end with |Z|.
% 
%   FIXME: I should append |,Z| automatically to every scheme-list and check
%   for an empty scheme-list.
%    \begin{macrocode}
\newcommand\NewCopystyle [2][Z] {% args: [scheme-list] new-copystyle
  \addto@macro\sc@copystyle@list{,#2}%
  \@for\bt@a:=\sc@bitstyle@list \do {%
    \@for\bt@b:=\sc@scheme@components \do {%
      \eExpand\bt@b\In {%
          \expandafter\sc@assign@schemecomponent
            \expandafter{\bt@a}{#2}{##1}{#1}%
      }%
    }%
  }%
}
\newcommand\NewBitstyle [2][Z] {% args: [scheme-list] new-bitstyle
  \addto@macro\sc@bitstyle@list{,#2}%
  \@for\bt@a:=\sc@copystyle@list \do {%
    \@for\bt@b:=\sc@scheme@components \do {%
      \eExpand\bt@a\In {%
        \eExpand\bt@b\In {%
%        \eExpandNest\bt@b\In {%  FIX?
          \sc@assign@schemecomponent{#2}{##1}{####1}{#1}%
        }%
      }%
    }%
  }%
}
\newcommand\sc@assign@schemecomponent [4] {% args: bitstyle copystyle 
                                           %       scheme-component scheme-list
  \@bt@trymoreschemes@true
  \edef\bt@d{#4}% scheme-list that diminishes; edef not necessary
  \@whilesw\if@bt@trymoreschemes@\fi {%
%    \end{macrocode}
% There's at least one element to start; and the last scheme (\cat{Z}) is always
% defined.
%    \begin{macrocode}
    \edef\bt@c{%
      \sc@listcar\bt@d,\@nil
    }
    \@ifundefined{sc@make@#3@\bt@c} {%
        \edef\bt@d{\sc@listcdr\bt@d,\@nil}%
        }{% ELSE
      \@nameuse{sc@make@#3@\bt@c}{#1}{#2}%
      \@bt@trymoreschemes@false
      }%
  }%
}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
% \begin{macro}{\PromulgateComponentAcrossCopystyles}
% \begin{macro}{\PromulgateComponentAcrossBitstyles}
%   \mbox{}
%    \begin{macrocode}
\newcommand\PromulgateComponentAcrossCopystyles [3] {% args: scheme-component
						     % scheme bitstyle
  \@for\bt@a:=\sc@copystyle@list \do {%
    \@nameuse{sc@make@#1@#2}{#3}{\bt@a}%
  }%
}
\newcommand\PromulgateComponentAcrossBitstyles [3] {% args: scheme-component
						    % scheme copystyle
  \@for\bt@a:=\sc@bitstyle@list \do {%
    \@nameuse{sc@make@#1@#2}{\bt@a}{#3}%
  }%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\sc@begin@bit@common}
% \begin{macro}{\BitStyle}
% \begin{macro}{\PreBitAll}
%   \cname{sc@begin@bit@common} should be called early in the sequence of
%   beginning a bit.
%    \begin{macrocode}
\newcommand\sc@begin@bit@common [2] {%
  \title{#1}%
%    \end{macrocode}
% Execute stuff: FIXME: nice hooks can be set here to execute things later
%    \begin{macrocode}
  #2% 
  \refstepcounter{bit}%
  \ifnum\value{bit} = \@ne
    \@nameuse{sc@firstbit@\CopyStyle}%
  \else
    \@nameuse{sc@interbits@\CopyStyle}%
  \fi
}
\ReserveCS\BitStyle
\ReserveCS\PreBitAll
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
%   \subsection{Schemes}
%
%     \subsubsection{The \cat{Z} scheme}
%
% \begin{macro}{\FullTitle}
%   The \cat{Z} scheme is always the last resort deafult, and it corresponds to
%   the standard copystyle and the generic bitstyle.
%
% FIXME: whenever we have a dummy we have to use DefName or else we error
% FIXME: Aak, when Promulgating we need defnames for everyting!
%    \begin{macrocode}
\newcommand\sc@make@environment@Z [2] {% args: bitstyle dummy
  \DefName{end#1}{}{}%
  \DefName{#1}{##1##2} {%
    \DefName{end#1}{} {%
      \@nameuse{sc@end@bit@#1@\CopyStyle}{##1}%
    }%
    \@nameuse{sc@begin@bit@#1@\CopyStyle}{##1}{##2}%
  }%
}
\newcommand\sc@make@interbits@Z [2] {% args: dummy copystyle
  \DefName{sc@interbits@#2}{} {%
    \@nameuse{sc@settitle@\BitStyle @#2}%
  }%
}
\newcommand\sc@make@firstbit@Z [2] {% args: dummy copystyle
  \DefName{sc@firstbit@#2}{} {%
    \@nameuse{sc@setfirsttitle@\BitStyle @#2}%
  }%
}
\newcommand\sc@make@begin@bit@Z [2] {% args: bitstyle copystyle
  \DefName{PreBit#1}{}{}%
  \DefName{sc@begin@bit@#1@#2}{##1##2} {%
    \def\BitStyle{#1}%
    \sc@begin@bit@common{##1}{##2}%
    \PreBitAll
    \@nameuse{PreBit#1}%
  }%
}
\newcommand\sc@make@end@bit@Z [2] {% args: bitstyle copystyle
  \DefName{sc@end@bit@#1@#2}{##1} {%
    \TheEnd
  }%
}
\newcommand\sc@make@settitle@Z [2] {% args: bitstyle copystyle
  \DefName{sc@settitle@#1@#2}{} {%
    \relax\begin{center}\FullTitle\end{center}%
    \typeout{FIXME:  need vc footer}%
  }%
}
\newcommand\sc@make@setfirsttitle@Z [2] {% args: bitstyle copystyle
  \DefName{sc@setfirsttitle@#1@#2}{} {%
    \relax\begin{center}\FullTitle\end{center}%
    \typeout{FIXME:  need vc footer}%
    \typeout{FIXME first centered title}%
  }%
}
\newcommand\FullTitle {%
  \relsize{2}%
  \bfseries
  \BitTitle \\%
  \ifx\BitSubtitle\ShortEmpty
  \else
    \csname sbseries\endcsname  % this way it's harmless if undefined
    \relsize{-1}\BitSubtitle\\%
  \fi
}
%    \end{macrocode}
% \end{macro}
%
%     \subsubsection{The \cat{P} scheme}
%
% \begin{macro}{\sc@make@setfirsttitle@P}
% \begin{macro}{\sc@make@settitle@P}
% \begin{macro}{\sc@make@end@bit@P}
% \begin{macro}{\sc@make@begin@bit@P}
% The \cat{P} scheme was created for the poem bitstyle.
%    \begin{macrocode}
\newcommand\sc@make@begin@bit@P [2] {% args: bitstyle copystyle
  \DefName{sc@begin@bit@#1@#2}{##1##2} {%
    \def\BitStyle{#1}%
    \sc@begin@bit@common{##1}{##2}%
    \PreBitAll
    \relax\begin{verse}%                 \relax for emacs
    \@nameuse{PreBit#1}%
  }%
}
\newcommand\sc@make@end@bit@P [2]  {% args: bitstyle copystyle
  \DefName{sc@end@bit@#1@#2}{##1} {%
    \relax\end{verse}%
    \TheEnd
  }%
}
\newcommand\sc@make@settitle@P [2]  {% args: bitstyle copystyle
  \DefName{sc@settitle@#1@#2}{} {%
    \relax\begin{verse}\FullTitle\end{verse}%
    \typeout{FIXME:  need vc footer}%
  }%
}
\newcommand\sc@make@setfirsttitle@P [2]  {% args: bitstyle copystyle
  \DefName{sc@setfirsttitle@#1@#2}{} {%
    \relax\begin{verse}\FullTitle\end{verse}%
    \typeout{FIXME:  need vc footer}%
    \typeout{FIXME first verse title}%
  }%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%     \subsubsection{The \cat{R} scheme}
%  For the prose bitstyle.
%    \begin{macrocode}
\newcommand\sc@make@settitle@R [2] {%
  \DefName{sc@settitle@#1@#2}{} {%
    \ifx\BitTitle\ShortEmpty\else
      \noindent
      \begingroup
        \larger
        \bfseries
        \BitTitle
      \endgroup
      \smallskip
    \fi
  }%
}
%    \end{macrocode}
%
%     \subsubsection{The \cat{T} scheme} for what?
%
% \section{The standard copystyle and generic bitstyle}
%
%    \begin{macrocode}
\@for\bt@e:=\sc@scheme@components \do {%
  \PromulgateComponentAcrossBitstyles{\bt@e}{Z}{standard}
}
%    \end{macrocode}
%
% \section{Bit Styles}
%
%   \subsection{Story}
% This is the same as generic.
%    \begin{macrocode}
\NewBitstyle{story}
%    \end{macrocode}
%
%   \subsection{Poem}
%
%    \begin{macrocode}
\NewBitstyle{poem}
\PromulgateComponentAcrossCopystyles{begin@bit}{P}{poem}
\PromulgateComponentAcrossCopystyles{end@bit}{P}{poem}
\PromulgateComponentAcrossCopystyles{settitle}{P}{poem}
\PromulgateComponentAcrossCopystyles{setfirsttitle}{P}{poem}
%    \end{macrocode}
%
%   \subsection{Prose}
%
%    \begin{macrocode}
\NewBitstyle{prose}
\PromulgateComponentAcrossCopystyles{settitle}{R}{prose}
%    \end{macrocode}
%
% \section{Copy Styles}
%
%    \begin{macrocode}
\NewCopystyle{titlepage}

\newcommand\sc@make@setfirsttitle@T [2] {% args: bitstyle copystyle
  \DefName{sc@setfirsttitle@#1@#2}{} {%
    \thispagestyle{empty}%
    \vspace*{\fill}%
    \begin{center}
      {\relsize{5}\BitTitle \\}%
      \ifx\BitSubtitle\ShortEmpty\else
        {\relsize{3}\BitSubtitle \\}%
      \fi
    \end{center}
    \vfill
%      \CoverNotes
%      \vfill
    \par
    \begingroup
      \sffamily
      \hfill
      \begin{tabular}{r@{\hspace{\@ne em}}r}
        Copy of:&\todayabbrev   \\%
        Version of:&\Lastchange \\%
        Date:&\Date             \\%     
      \end{tabular}
      \par\bigskip\bigskip
      \begin{raggedleft}
        \def\and{\\}%
        \larger\scshape\Author
%    \end{macrocode}
% A final |\par| is needed to close the paragraph in raggedleft mode.
%    \begin{macrocode}
        \par
      \end{raggedleft}
    \endgroup
    \newpage
    \setcounter{page}{\@ne}%
  }%
}
\PromulgateComponentAcrossBitstyles{setfirsttitle}{T}{titlepage}
%    \end{macrocode}
%
% \section{Bit counters and interbit skips}
%
% \begin{macro}{\c@bit}
% \begin{macro}{\c@bitbit}
% \begin{macro}{\c@bitbitbit}
%   \mbox{}
%    \begin{macrocode}
\providecounter{bit}
\providecounter{bitbit}[bit]
\providecounter{bitbitbit}[bitbit]
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\sc@bitskip}
%  \begin{macro}{\InterBitBreak}
%  \begin{macro}{\InterBitBitBreak}
%  \begin{macro}{\InterBitBitBitBreak}
% \cs\medbreak is penalty -100; \cs\smallbreak is 50.  FIXME: what's going on
% here?
%    \begin{macrocode}
\newcommand\sc@bitskip[1] {%
  \par
  \ifdim \lastskip < \bigskipamount
    \removelastskip
    \penalty -500%
    #1%
  \fi
}  
\newcommand\InterBitBreak {%
  \sc@bitskip
  \bigskip
}
\newcommand\InterBitBitBreak {%
  \sc@bitskip
  \medskip
}
\newcommand\InterBitBitBitBreak {%
  \sc@bitskip
  \smallskip
}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
% \begin{macro}{\bitbit}
% \begin{macro}{\bitbitbit}
% \begin{macro}{\sc@bitbit}
% \begin{macro}{\sc@bitbitbit}
%   FIXME: These should be made attributes of the Generic Bit Style.
%    \begin{macrocode}
\newcommand\bitbit {%
  \@ifstar {%
      \sc@bitbit{}%
    }{% ELSE
    \refstepcounter{bitbit}%
    \sc@bitbit{\thebitbit\ }%
  }%
}
\newcommand{\sc@bitbit} [2] {%
  \ifnum\value{bitbit}=\@ne \else
     \InterBitBitBreak
  \fi
  \noindent #1{\relsize{-1}\bfseries #2}%
  \par\nobreak
  \smallskip
}
\newcommand\bitbitbit {%
  \@ifstar {%
      \sc@bitbitbit{}%
    }{% ELSE
    \refstepcounter{bitbitbit}%
    \sc@bitbitbit{\thebitbitbit\ }%
  }%
}
\newcommand\sc@bitbitbit [2] {%
  \ifnum\value{bitbitbit}=\@ne \else
    \InterBitBitBitBreak
  \fi
  \noindent #1{\relsize{-1}\bfseries #2}%
  \par\nobreak
  \smallskip
}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%  \end{macro}
%
% \section{Userinfos}
%
% \begin{macro}{\Author}
% \begin{macro}{\author}
% \begin{macro}{\Lastchange}
% \begin{macro}{\lastchange}
% \begin{macro}{\Date}
% \begin{macro}{\date}
% \begin{macro}{\title}
% \begin{macro}{\BitTitle}
% \begin{macro}{\BitSubtitle}
% When we redefine \cs\author, \cs\date, and \cs\title, we add a new action to
% the original meaning.  This means that standard commands like \cs\maketitle
% will still perform as expected, if someone prefers to use that instead of the
% \monster commands.
%    \begin{macrocode}
\newlet\sc@saved@author\author
\newlet\sc@saved@date\date

\ReserveCS\Author
\defcommand\author [1] {%
  \sc@saved@author{#1}%
  \def\Author{#1}%
}
\newcommand*\Date {%
  \todayabbrev
}
\defcommand\date [1] {%
  \sc@saved@date{#1}%
  \def\Date{#1}%
}
\newlet\sc@saved@title\title
\ReserveCS\BitTitle

\defcommand\title [1] {%
  \sc@saved@title{#1}%
  \def\BitTitle{#1}%
}
\NewUserInfo*[\Subtitle]\BitSubtitle
\newlet\subtitle\Subtitle
\NewUserInfo*\Lastchange
\lastchange{\todayabbrev}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\Copystyle}
% \begin{macro}{\copystyle}
%   \mbox{}
%    \begin{macrocode}
\NewUserInfo*\CopyStyle
\copystyle{standard}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
% \section{Dates}
%
% \begin{macro}{\today}
% \begin{macro}{\todayabbrev}
%   \mbox{}
%    \begin{macrocode}
\def\today {%
  \number\day\space\ifcase\month\or 
        January\or February\or
        March\or April\or May\or June\or July\or August\or September\or
        October\or November\or December\fi\space\number\year
}
\newcommand\todayabbrev {%
  \number\day\space\ifcase\month\or 
        Jan\or Feb\or
        Mar\or Apr\or May\or Jun\or Jul\or Aug\or Sep\or
        Oct\or Nov\or Dec\fi\space\number\year
}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
% \begin{macro}{\copywrite}
%   This adds a copyright message to the beginning of \cs\Notes.  Its single
%   argument should be a year.
%    \begin{macrocode}
\newcommand\copywrite [1] {%
  \edef\Notes {%
    \copyright#1 All rights reserved. \Notes
  }%
}
%    \end{macrocode}
%  \end{macro}
%
% \section{Ends}
%
% \begin{macro}{\EndSign}
%   It's very hard to attach this thing without allowing a page break before it. FIX.
%    \begin{macrocode}
\newcommand\EndSign {%
  \par\nobreak
  \vspace{2\bigskipamount}%  multiplication turns glue into dimen.
  \hfill
%    \end{macrocode}
% We do this so that |\Author| can have |\\|s in it.
%    \begin{macrocode}
  \begingroup
    \scshape
    \let\and\@tabularcr
    \begin{tabular}{c}
      \Author \\% 
      \relsize{-1}\itshape\Date
    \end{tabular}%
  \endgroup
}
%    \end{macrocode}
%  \end{macro}
%
% \begin{macro}{\theend}
%   User command which (almost) always makes an \cs\EndSign:
%    \begin{macrocode}
\newcommand\theend {%
  \if@signed@
    \EndSign
  \fi
}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\TheEnd}
%   The end of a bit calls \cs\TheEnd.  The default definition is either
%   nothing or \cs\EndSign, depending on some condition.
%    \begin{macrocode}
\newcommand\TheEnd {%
  \def\sc@t@c {%
    prizes%
  }%
  \let\sc@t@a\EndSign
  \ifx\CopyStyle\sc@t@c
    \InitCS*\sc@t@a
  \else
    \if@signed@
      \if@ends@
        \ifnum\value{page} < 2%
          \InitCS*\sc@t@a
        \fi
      \else
        \InitCS*\sc@t@a
      \fi
    \else
      \InitCS*\sc@t@a
    \fi
  \fi
  \sc@t@a
}
%    \end{macrocode}
% \end{macro}
%
% \section{Version control}
%
% We use macros instead of boxes, because at this point some of the macros in
% the boxes may change their meaning.  
%
% Algorithm: We will maintain two |\hbox|es |to \textwidth| each time
% |\MakeCover| is called.  Set the footboxes to |\v@idbox| here.  Whenever
% |\MakeCover| is called, it should stack another |\vbox| with the right
% information in it into both boxes.  The information is expanded, and thus the
% macro contents can change between calls to |\MakeCover|, but the box being
% built inserts two different |\vboxes| with their value at the moment.
%
% \begin{macro}{\sc@vcbox}
% \begin{macro}{\VersionControlString}
% \begin{macro}{\VersionControlAuthorString}
%   \mbox{}
%    \begin{macrocode}
\newcommand\sc@vcbox {%
  \footnotesize
  \ifx\Lastchange\ShortEmpty\else
    {\bfseries Version:} {\slshape \Lastchange}%
  \fi
  \hspace{\@ne em}%
  {\bfseries Copy:} {\slshape \todayabbrev}%
}
\newcommand\VersionControlString {%
  \hfill \sc@vcbox \hfill
}
%    \end{macrocode}
% I should assign some names to the various meanings of and, like protect.
%    \begin{macrocode}
\newcommand\VersionControlAuthorString {%
  \sc@vcbox \hfill {\scshape\def\and{\unskip, \ignorespaces}\Author}%
}
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%     
% \section{Addresses}
%
% \begin{macro}{\AddressOne}
% \begin{macro}{\AddressTwo}
% \begin{macro}{\PhoneNumber}
% \begin{macro}{\EmailAddress}
% \begin{macro}{\Country}
% \begin{macro}{\addressone}
% \begin{macro}{\addresstwo}
% \begin{macro}{\phonenumber}
% \begin{macro}{\emailaddress}
% \begin{macro}{\country}
%   \mbox{}
%    \begin{macrocode}
\NewUserInfo*\AddressOne
\NewUserInfo\AddressTwo  % this can have an extra line if necessary.
\NewUserInfo*\PhoneNumber
\NewUserInfo*\EmailAddress
\NewUserInfo*\Country
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\whitespace}
%   \mbox{}
%    \begin{macrocode}
\requirecommand\whitespace {%
  \bigbreak
}
%    \end{macrocode}
%  \end{macro}
%
% \section{Configuration}
%
% We leave the rest to a configuration file.
%    \begin{macrocode}
\InputIfFileExists{bits.cfg}{}{}
%    \end{macrocode}
%
%  The contents of the distributed configuration file are below.
%
% \InputIfFileExists{bits.cfg}{}{}
%
% \Finale
