%% @texfile{
%%     filename="tbcont.def",
%%     version="1.04",
%%     date="15-Oct-1993",
%%     filetype="Plain TeX macros for TUGboat tables of contents",
%%     copyright="Copyright (C) TeX Users Group.
%%            Copying of this file is authorized only if either:
%%            (1) you make absolutely no changes to your copy, OR
%%            (2) if you do make changes, you first rename it to some
%%                other name.",
%%     author="TeX Users Group",
%%     address="TeX Users Group",
%%            P. O. Box 869,
%%            Santa Barbara, CA 93102,
%%            USA",
%%     telephone="805-963-1338",
%%     email="Internet: TUGboat@Math.AMS.org",
%%     codetable="ISO/ASCII",
%%     checksumtype="line count",
%%     checksum="233",
%%     keywords="tex users group, tugboat, tables of contents",
%%     abstract="This file contains the plain-based macros
%%            for preparing tables of contents for TUGboat,
%%            the Communications of the TeX Users Group."
%%     }
%% *********************************************************
%%
%%  TeXing with this file also requires the following files:
%%      TUGBOAT.STY (version 1.10+)
%%      TUGBOAT.CMN (version 1.08+)
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% TBCONT.DEF

\def\fileversion{v1.04}
\def\filedate{15 October 1993}

\input tugboat.sty

%  Make @ signs act like letters, for use in internal control sequences.
\makeatletter

%  Define additional fonts.

\StretchyNinePointSpacing

% %  Reset -- this font defaults to cmssbx10 in TUGBOT.STY.
% \font\manual=manfnt % font used for the METAFONT logo

\font\twelverm=cmr10  scaled \magstep1
\font\twelvebf=cmbx10 scaled \magstep1
\font\twelvesl=cmsl10 scaled \magstep1
\font\twelveit=cmti10 scaled \magstep1
\let\twelvei=\twelveit
\font\twelvesy=cmsy10 scaled \magstep1
\font\twelvett=cmtt10 scaled \magstep1

\def\twelvepoint{\baselineskip 14pt
    \def\rm{\fam0\twelverm}%
    \textfont0=\twelverm \scriptfont0=\eightrm \scriptscriptfont0=\sixrm
    \textfont1=\twelvei  \scriptfont1=\eighti  \scriptscriptfont1=\sixi
    \textfont2=\twelvesy \scriptfont2=\eightsy \scriptscriptfont2=\sixsy
    \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
    \def\it{\fam\itfam\twelveit}%
    \textfont\itfam=\twelveit
    \def\sl{\fam\slfam\twelvesl}%
    \textfont\slfam=\twelvesl
    \def\bf{\fam\bffam\twelvebf}%
    \textfont\bffam=\twelvebf \scriptfont\bffam=\eightbf
        \scriptscriptfont\bffam=\sixbf
    \def\smc{\tenrm}%
    \def\tt{\twelvett}%
    \rm }

%
\font\elevenrm=cmr10 scaled \magstephalf
\let\eleveni=\teni
\let\elevensy=\tensy
\font\fourteenrm=cmr10 scaled \magstep2
\font\fourteenit=cmti10 scaled \magstep2
\let\fourteeni=\fourteenit
\let\fourteensy=\tensy

\def\fourteenpoint{\baselineskip 16pt
    \def\rm{\fam0\fourteenrm}%
    \textfont0=\fourteenrm \scriptfont0=\elevenrm \scriptscriptfont0=\sevenrm
    \textfont1=\fourteenit \scriptfont1=\eleveni  \scriptscriptfont1=\seveni
    \textfont2=\fourteensy \scriptfont2=\elevensy \scriptscriptfont2=\sevensy
    \textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
    \def\smc{\elevenrm}%
    \rm }

\font\sixteenrm=cmr10 scaled \magstep3
\font\sixteenbf=cmbx10 scaled \magstep3
\def\bigfont{\def\rm{\sixteenrm}\def\smc{\twelverm}%
    \def\bf{\sixteenbf \def\smc{\twelvebf}}\rm }


\def\comment#1\endcomment{}                % AMS-TeX not loaded

%  Increase page length to accommodate long contents pages.
\normalcollgt=60pc
\collgt=\normalcollgt
\rheadlgt=0pt
\def\runhead{\hrule height 0pt depth 0pt width 10pt \vskip-2.5pc }
\rfootlgt=0pt   \def\runfoot{}
\resetpagelgt

\onecol

%
%  control sequences for contents page

\newskip\normalsecskip
\newskip\secskipa       \newskip\secskipb
\normalsecskip=5pt
\secskipa=\normalsecskip
\secskipb=1pt
\newdimen\secht         \newdimen\secwd
\newif\ifnewsec
\newif\ifFirstR@nin     \FirstR@nintrue
\newbox\SecBox

\def\sec #1<{\def\\{\unskip\cr}%
    \setbox\SecBox=\vbox to \secht
        {\bf\halign{\hfil ##\cr\strut#1\cr}\vss}%
    \newsectrue \FirstR@nintrue }
\def\secsec #1\\#2<{\sec #1<%
    \subsecnn {}\\#2<}

\newdimen\@secwd        \@secwd=1.5in
\newdimen\@hangindwd                            % 2in
\newdimen\hangindif     \hangindif=.3in
\@hangindwd=\@secwd \advance\@hangindwd by 2\hangindif
\newdimen\digitwidth

\def\setdigitwidth #1{\setbox\TestBox=\hbox{#1}%
    \global\digitwidth=\wd\TestBox }
\setdigitwidth{99}

%  Permit page ranges separated by hyphen (to support Nelson Beebe's
%  citation builder), but print only the starting page number.
\def\strippageno#1-#2<{#1\unskip}

\def\newsubs@c#1#2{%
    \ifnewsec \vskip\secskipa \newsecfalse \else \vskip\secskipb \fi
    \noindent \hangindent=\@hangindwd
    \leavevmode \hbox to \@secwd{\hss\box\SecBox \quad
                \hbox to \digitwidth{\hss\strippageno#1-<}\quad}%
    {\ignorespaces #2\unskip}}

%  If either author or title absent, omit / separator.
%  If this is a proceedings issue, reverse order of author / title.
\def\subsec #1\\#2\\#3<{\par
    \TestCount=0                                        % case to set /
    \setbox\TestBox=\hbox{#1\unskip}%
    \ifdim\wd\TestBox < .2em \TestCount=1               % case to omit /
    \else \setbox\TestBox=\hbox{#2\unskip}%
        \ifdim\wd\TestBox < .2em \TestCount=1 \fi \fi
    \newsubs@c{\ignorespaces#3}{\ifprocissue#1\else\ignorespaces#2\fi}%
    \ifcase\TestCount
        \hskip.5em\raise.3ex\hbox{\sevenrm/}\penalty-10\hskip.4em\fi
    {\sl \ifprocissue\ignorespaces#2\else#1\fi\unskip}\endgraf}
%
\def\subseca #1\\#2<{\subsec #1\\#2\\ <}
\def\subsecnn #1\\#2<{\subsec \ifprocissue#1\fi\\%
    \ifprocissue\else#1\fi\\#2<}
\def\subseci #1\\#2<{\subsecnn \hbox to \hangindif{}#1\\#2<}
\def\subsecii #1\\#2<{\subsecnn \hbox to 2\hangindif{}#1\\#2<}

\newdimen\subsecchang
\subsecchang=\@hangindwd
\advance\subsecchang by-\hangindif
\def\subsecc #1<{\noindent \kern\subsecchang
    \hangindent=\subsecchang #1\unskip\endgraf }

\def\subsite #1<{\ifdim\wd\SecBox > .2em \subsec {}\\ \\ <%
    \else \setbox\SecBox=\hbox{\eightrm$\cdot$\kern.25em#1}\fi }

\def\subsub #1<{\subsecnn #1\\ <}

\def\subquery #1\\#2\\#3<{%
    \ifFirstR@nin \FirstR@ninfalse \newsubs@c{#3}{#2}%
        \hangindent=\@secwd
    \else \unskip ;\penalty-50\hskip.6em \ignorespaces #2\unskip
    \fi
    \setbox\TestBox=\hbox{#1\unskip}%
        \ifdim\wd\TestBox > .2em \penalty-10\ ({\sl #1\/})\fi }

\def\and{\unskip{\rm\penalty 20\hskip.4em and\kern.06em}~}

\def\SetupContents{\onecol
%               % page size may be reset in tbcv*.tex
    \raggedstretch=.5\colwd             % usual 5em isn't enough here
    \raggedright
    \hyphenpenalty=10000                % no hyphenation, none at all
    \exhyphenpenalty=10000
    \uchyph=0 }
\SetupContents

%  To support cumulative contents, initialize size-specific
%  features after type size has been chosen.

%  allow additional information for special issues
\newif\ifprocissue
\let\postissno\empty

\def\TUBhead #1, #2, #3<{\setbox\TestBox=\hbox{()}\secht=\ht\TestBox
    \sec \null <\newsecfalse            % initialize section box
    \procissuefalse
    \subsub{\bigfont\bf TUG{\smc BOAT}}<
    \vskip 10pt
    {\twelverm\baselineskip=15pt
        \subsub Volume #1, Number #2%
        \hskip.5em\raise.25ex\hbox{\ninebf/}\hskip.4em #3<
     \ifx\postissno\empty \global\procissuefalse
     \else\subsub \postissno<
        \global\procissuetrue
     \fi }
    \vskip 20pt }

%  Restore @ to normal status.
\makeatother

%  This is "camera copy".
\PrelimDraftfalse
\pageno=1

%  Allow overlong lines.
\NoBlackBoxes

\endinput
