diff options
author | Fred Drake <fdrake@acm.org> | 1998-02-16 22:30:10 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 1998-02-16 22:30:10 (GMT) |
commit | 76183c0ed839a27ed6afdeb94ecabcf5b47c1091 (patch) | |
tree | 6220ad94a2f4b4f42956d437e66d1052be5c8d21 | |
parent | 9ac9a26f083d0e0b8081043fafe6fa0506fb1436 (diff) | |
download | cpython-76183c0ed839a27ed6afdeb94ecabcf5b47c1091.zip cpython-76183c0ed839a27ed6afdeb94ecabcf5b47c1091.tar.gz cpython-76183c0ed839a27ed6afdeb94ecabcf5b47c1091.tar.bz2 |
Move optional package inclusions to the top, to make them easier to find.
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?)
-rw-r--r-- | Doc/myformat.sty | 56 |
1 files changed, 51 insertions, 5 deletions
diff --git a/Doc/myformat.sty b/Doc/myformat.sty index f06f831..b38ad90 100644 --- a/Doc/myformat.sty +++ b/Doc/myformat.sty @@ -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 @@ -26,10 +45,39 @@ \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 @@ -368,6 +416,7 @@ }% \cleardoublepage% \pagenumbering{arabic}% + \@ifundefined{fancyhf}{}{\pagestyle{normal}}% } % Allow the release number to be specified independently of the @@ -489,6 +538,3 @@ } \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.} |