\mytableofcontents New macro. Wrapper around \tableofcontents that

does the right thing if the openright option is given.  Allows a
	lot of crud to be removed from the document files' frontmatter
	sections.

\endabstract		Extend standard macro.  (Called as \end{abstract}.)
	Does the right thing if the openright option is given.

\optional		Adjust to get the brackets right under latex2e.
This commit is contained in:
Fred Drake 1998-01-09 05:34:23 +00:00
parent 46fbd7f4a0
commit 031ad4b2a0
1 changed files with 37 additions and 1 deletions

View File

@ -158,7 +158,7 @@
\newcommand{\funcline}[2]{\item[\code{#1(\varvars{#2})}]\ttindex{#1}} \newcommand{\funcline}[2]{\item[\code{#1(\varvars{#2})}]\ttindex{#1}}
\newcommand{\funcdesc}[2]{\fulllineitems\funcline{#1}{#2}} \newcommand{\funcdesc}[2]{\fulllineitems\funcline{#1}{#2}}
\let\endfuncdesc\endfulllineitems \let\endfuncdesc\endfulllineitems
\newcommand{\optional}[1]{{\ \Large[}{#1}\hspace{0.5mm}{\Large]}\ } \newcommand{\optional}[1]{{\ \textnormal{\Large[}}{#1}\hspace{0.5mm}{\textnormal{\Large]}}\ }
% same for excdesc % same for excdesc
@ -253,3 +253,39 @@
\OldTheindex% \OldTheindex%
\addcontentsline{toc}{chapter}{\indexname}% \addcontentsline{toc}{chapter}{\indexname}%
} }
% Use a similar trick to catch the end of the {abstract} environment,
% but here make sure the abstract is followed by a blank page if the
% 'openright' option is used.
%
\let\OldEndAbstract=\endabstract
\def\endabstract{%
\if@openright%
\ifodd\value{page}%
\typeout{Adding blank page after the abstract.}%
\vfil\pagebreak%
\fi
\fi%
\OldEndAbstract%
}
% \mytableofcontents wraps the \tableofcontents macro with all the magic to
% get the spacing right and have the right number of pages if the 'openright'
% option has been used. This eliminates a fair amount of crud in the
% individual document files.
%
\newcommand{\mytableofcontents}{%
\pagebreak%
\pagestyle{plain}%
{%
\parskip = 0mm%
\tableofcontents
\if@openright
\ifodd\value{page}%
\typeout{Adding blank page after the table of contents.}%
\pagebreak\hspace{0pt}%
\fi
\fi
}
\pagebreak%
}