]> granicus.if.org Git - python/commitdiff
\mytableofcontents New macro. Wrapper around \tableofcontents that
authorFred Drake <fdrake@acm.org>
Fri, 9 Jan 1998 05:34:23 +0000 (05:34 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 9 Jan 1998 05:34:23 +0000 (05:34 +0000)
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

index e4c9ff571c9a5a7478767d8731954a7f367e709f..808c749786fc984980c7bd7098061e05ff2879a8 100644 (file)
 \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
   \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%
+}