From 031ad4b2a058214e34f74829e3cf4b404d7704ed Mon Sep 17 00:00:00 2001 From: Fred Drake Date: Fri, 9 Jan 1998 05:34:23 +0000 Subject: \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. --- Doc/myformat.sty | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/Doc/myformat.sty b/Doc/myformat.sty index e4c9ff5..808c749 100644 --- a/Doc/myformat.sty +++ b/Doc/myformat.sty @@ -158,7 +158,7 @@ \newcommand{\funcline}[2]{\item[\code{#1(\varvars{#2})}]\ttindex{#1}} \newcommand{\funcdesc}[2]{\fulllineitems\funcline{#1}{#2}} \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 @@ -253,3 +253,39 @@ \OldTheindex% \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% +} -- cgit v0.12