%\filename{contentsmacros.tex}
%\edited{last by stolfi on Thu May 26 23:46:48 1988}

% Special macros for table of contents:

\catcode`@=11\endlinechar=-1

  \newdimen\secindent

  % Special title formats for printing book skeletons

  \def\dotfill{\leaders\hbox to 1em{\hss . \hss}\hfill}
  \def\contline#1#2{\hbox to\hsize{#1\ \dotfill #2}}
  
  \def\GENCHAP #1#2#3{
    \vfil\penalty-10\vfilneg
    \vskip 5pt
    \gdef\curchaptag{#1}
    \contline{#2}{#3}
  }
  
  \outer\def\CHAPTER #1#2#3{\GENCHAP {#1}{Chapter \Ch{#1}. #2}{#3}}
  \outer\def\APPENDIX #1#2#3{\GENCHAP {#1}{#2}{#3}}
  \outer\def\JUNK #1#2#3{\GENCHAP {#1}{Junk \Ch{#1}. #2}{#3}}

  \outer\def\SECTION #1#2#3{
    \contline{\hphantom{Chapter} \Ch{\curchaptag}.#1. #2}{#3}
  }

  \outer\def\SUBSECTION #1#2#3{}

  \def\begincontents{
    \begingroup
      \rm \secindent=\textindentglue
      \parindent=0pt
      \def\smallvglue{0.3\baselinesep}
      \def\medvglue{0.75\baselinesep}
      \def\bigvglue{1.2\baselinesep}
      \advance\baselinesep by -0.5pt
   }

  \def\endcontents{\endgroup}

\catcode`@=12\endlinechar=`\^^M

% END

