cryptol/docs/ProgrammingCryptol/utils/trickery.tex
2014-04-17 15:34:25 -07:00

89 lines
2.9 KiB
TeX

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% The following is copied from book.cls
%%% Beware: if the style changes, change this too
\makeatletter
\renewenvironment{thebibliography}[1]{%
\chapter*{\bibname
\@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}}%
\phantomsection
\addcontentsline{toc}{chapter}{Bibliography}
(Each entry is followed by a list of page numbers on which
the citation appears. All cited URLs, unless otherwise stated, were last accessed in November 2010.)\\
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% index trickery
\makeatletter
\renewenvironment{theindex}{%
\if@twocolumn
\@restonecolfalse
\else
\@restonecoltrue
\fi
\columnseprule \z@
\columnsep 35\p@
\twocolumn[\@makeschapterhead{\indexname}
\phantomsection
\addcontentsline{toc}{chapter}{Index}
%\noindent (Some explanations or yet others totally unrelated but still
%useful might go here or there. no one cares.)\\
]%
\@mkboth{\MakeUppercase\indexname}%
{\MakeUppercase\indexname}%
\parskip\z@ \@plus .3\p@\relax
\let\item\@idxitem}
{\if@restonecol\onecolumn\else\clearpage\fi}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% toc trickery
\makeatletter
\renewcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\phantomsection
\addcontentsline{toc}{chapter}{Contents}
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% lof trickery
\makeatletter
\renewcommand\listoffigures{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\chapter*{\listfigurename
\@mkboth{\MakeUppercase\listfigurename}%
{\MakeUppercase\listfigurename}}%
\phantomsection
\addcontentsline{toc}{chapter}{List of Figures}
\@starttoc{lof}%
\if@restonecol\twocolumn\fi
}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%