]> granicus.if.org Git - python/commitdiff
Move optional package inclusions to the top, to make them easier to find.
authorFred Drake <fdrake@acm.org>
Mon, 16 Feb 1998 22:30:10 +0000 (22:30 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 16 Feb 1998 22:30:10 +0000 (22:30 +0000)
Code elsewhere in this file tests for the inclusion of the package and does
not need to be uncommented.  Comments explain what they do and how to
disable them.

Added support for the optional "fancyhdr" package.  If used, page footers
include chapter information on the left and section information on the right.

Both optional packages, "fancyhdr" and "times", are enabled by default.  We
may want to disable them before shipping, but I'm not completely convinced.
(How many installations format their own documentation?)

Doc/myformat.sty

index f06f831dea068befd3b608cb5eb1c0e792f9c8da..b38ad90e9b84c792da423dfda9cc7511d3e15f98 100644 (file)
@@ -4,15 +4,34 @@
 
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
 \ProvidesPackage{myformat}
-             [1998/01/11 $Revision$
+             [1998/01/11 
                  LaTeX package (Python manual markup)]
 
+% Optional packages:
+%
+% If processing of these documents fails at your TeX installation,
+% these may be commented out (independently) to make things work.
+% These are both supplied with the current version of the teTeX
+% distribution.
+%
+% The "fancyhdr" package makes nicer page footers reasonable to
+% implement, and is used to put the chapter and section information in 
+% the footers.
+%
+% The "times" package makes the default font the PostScript Times
+% font, which makes for smaller PostScript and a font that more people 
+% like.
+%
+\RequirePackage{fancyhdr}\typeout{Using fancier footers than usual....}
+\RequirePackage{times}\typeout{Using times fonts instead of Computer Modern.}
+
+
 % Increase printable page size (copied from fullpage.sty)
 \topmargin 0pt
 \advance \topmargin by -\headheight
 \advance \topmargin by -\headsep
 
-\textheight 8.9in
+\textheight 8.7in
 
 \oddsidemargin 0pt
 \evensidemargin \oddsidemargin
 \parindent =       0mm
 \parskip =         2mm
 
+% uncomment the following line if you have the fancyhdr package available:
 \pagestyle{empty}                      % start this way; change for
 \pagenumbering{roman}                  % ToC & chapters
 \setcounter{secnumdepth}{1}
 
+% Redefine the 'normal' header/footer style when using "fancyhdr" package:
+\@ifundefined{fancyhf}{}{
+  \fancypagestyle{normal}{%
+    \fancyhf{}%
+    \fancyfoot[LE,RO]{{\HeaderFamily\thepage}}%
+    \fancyfoot[LO]{{\HeaderFamily\nouppercase{\rightmark}}}%
+    \fancyfoot[RE]{{\HeaderFamily\nouppercase{\leftmark}}}%
+    \renewcommand{\headrulewidth}{0pt}%
+    \renewcommand{\footrulewidth}{0.4pt}%
+  }
+  % Update the plain style so we get the page number & footer line,
+  % but not a chapter or section title.  This is to keep the first
+  % page of a chapter and the blank page between chapters `clean.'
+  \fancypagestyle{plain}{%
+    \fancyhf{}%
+    \fancyfoot[LE,RO]{{\HeaderFamily\thepage}}%
+    \renewcommand{\headrulewidth}{0pt}%
+    \renewcommand{\footrulewidth}{0.4pt}%
+  }
+  % Redefine \cleardoublepage so that the blank page between chapters
+  % gets the plain style and not the fancy style.
+  \renewcommand{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
+    \hbox{}
+    \thispagestyle{plain}
+    \newpage
+    \if@twocolumn\hbox{}\newpage\fi\fi\fi}
+}
+
 % old code font selections:
 \let\codefont=\tt
 \let\sectcodefont=\tt
   }%
   \cleardoublepage%
   \pagenumbering{arabic}%
+  \@ifundefined{fancyhf}{}{\pagestyle{normal}}%
 }
 
 % Allow the release number to be specified independently of the
   }
   \typeout{Using fancy chapter headings.}
 }
-
-% Uncomment the following line to use a PostScript font instead of bitmaps:
-%\RequirePackage{times}\typeout{Using times fonts instead of Computer Modern.}