%		*****	TBCONT.DEF	*****			27 Oct 88, bb
%							revised: 20 Mar 90, bb
%							changed: 14 Jan 91, cs
%
%	This file contains the definitions necessary to produce the
%	TUGboat tables of contents.
%
%	This version is for TeX82, and presupposes PLAIN.

%\input tugbot.sty
\input tugboat.sty

%
%       Change by Christoph Strunk: add forgotten definition
%
%%%% Begin change %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\def\AMSTeX{\AmSTeX}
%
%%%% End change %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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

%	Define additional fonts.

%\extranineptstretch=30pt
\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

\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}%
	\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\secskipa \newskip\secskipb
\secskipa=5pt
\secskipb=1pt
\newdimen\secht \newdimen\secwd
\newif\ifnewsec
\newif\ifFirstR@nin	\FirstR@nintrue
\newbox\SecBox

\def \sec #1<{\def\\{\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.
\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{#3}{#2}%
	\ifcase\TestCount
		\hskip.5em\raise.3ex\hbox{\sevenrm/}\penalty-10\hskip.4em\fi
	{\sl\ignorespaces #1\unskip}\endgraf}

\def \subseca #1\\#2<{\subsec #1\\#2\\ <}
\def \subsecnn #1\\#2<{\subsec \\#1\\#2<}
\def \subseci #1\\#2<{\subsecnn \hbox to \hangindif{}#1\\#2<}
\def \subsecii #1\\#2<{\subsecnn \hbox to 2\hangindif{}#1\\#2<}

\def \subsite #1<{\ifdim\wd\SecBox > .2em \subsec {}\\ \\ <%
	\else \setbox\SecBox=\hbox			% to \secwd
			{\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\hskip.4em and\kern.06em}~}

\def \SetupContents{\onecol
%		% page size is 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.

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

\let\postissno\empty

%	Restore @ to normal status.
\makeatother

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

%	Allow overlong lines.
\NoBlackBoxes

\endinput
