comparison Doc/texinputs/python.sty @ 7548:7eb19b1ce84d legacy-trunk

Improve separation of document class and python semantic constructs. This will allow us to have a class of smaller documents as well.
author Fred Drake <fdrake@acm.org>
date Wed, 04 Mar 1998 21:47:59 +0000
parents 26a8771a4cfd
children 69860821ca1d
comparison
equal deleted inserted replaced
7547:d4d84b54c44d 7548:7eb19b1ce84d
8 8
9 % The "fncychap" package is used to get the nice chapter headers. The 9 % The "fncychap" package is used to get the nice chapter headers. The
10 % .sty file is distributed with Python, so you should not need to disable 10 % .sty file is distributed with Python, so you should not need to disable
11 % it. You'd also end up with a mixed page style; uglier than stock LaTeX! 11 % it. You'd also end up with a mixed page style; uglier than stock LaTeX!
12 % 12 %
13 \RequirePackage[Bjarne]{fncychap}\typeout{Using nice chapter headings.} 13 \RequirePackage[Bjarne]{fncychap}\typeout{Using fancy chapter headings.}
14 14
15 15
16 % for PDF output, use maximal compression 16 % for PDF output, use maximal compression
17 \@ifundefined{pdfannotlink}{ 17 \@ifundefined{pdfannotlink}{
18 \let\LinkColor=\relax 18 \let\LinkColor=\relax
119 \renewcommand{\footrulewidth}{0.4pt} 119 \renewcommand{\footrulewidth}{0.4pt}
120 } 120 }
121 % Redefine \cleardoublepage so that the blank page between chapters 121 % Redefine \cleardoublepage so that the blank page between chapters
122 % gets the plain style and not the fancy style. This is described 122 % gets the plain style and not the fancy style. This is described
123 % in the documentation for the fancyhdr package by Piet von Oostrum. 123 % in the documentation for the fancyhdr package by Piet von Oostrum.
124 \renewcommand{\cleardoublepage}{ 124 \@ifundefined{chapter}{}{
125 \clearpage\if@openright \ifodd\c@page\else 125 \renewcommand{\cleardoublepage}{
126 \hbox{} 126 \clearpage\if@openright \ifodd\c@page\else
127 \thispagestyle{plain} 127 \hbox{}
128 \newpage 128 \thispagestyle{plain}
129 \if@twocolumn\hbox{}\newpage\fi\fi\fi} 129 \newpage
130 \if@twocolumn\hbox{}\newpage\fi\fi\fi
131 }
132 }
130 } 133 }
131 134
132 % old code font selections: 135 % old code font selections:
133 \let\codefont=\tt 136 \let\codefont=\tt
134 \let\sectcodefont=\tt 137 \let\sectcodefont=\tt
521 \fi 524 \fi
522 \fi 525 \fi
523 \OldEndAbstract 526 \OldEndAbstract
524 } 527 }
525 528
526 % This wraps the \tableofcontents macro with all the magic to get the
527 % spacing right and have the right number of pages if the 'openright'
528 % option has been used. This eliminates a fair amount of crud in the
529 % individual document files.
530 %
531 \let\OldTableofcontents=\tableofcontents
532 \renewcommand{\tableofcontents}[0]{%
533 \setcounter{page}{1}%
534 \pagebreak%
535 \pagestyle{plain}%
536 {%
537 \parskip = 0mm%
538 \OldTableofcontents%
539 \if@openright%
540 \ifodd\value{page}%
541 \typeout{Adding blank page after the table of contents.}%
542 \pagebreak\hspace{0pt}%
543 \fi%
544 \fi%
545 }%
546 \cleardoublepage%
547 \pagenumbering{arabic}%
548 \@ifundefined{fancyhf}{}{\pagestyle{normal}}%
549 }
550
551 % Allow the release number to be specified independently of the 529 % Allow the release number to be specified independently of the
552 % \date{}. This allows the date to reflect the document's date and 530 % \date{}. This allows the date to reflect the document's date and
553 % release to specify the Python release that is documented. 531 % release to specify the Python release that is documented.
554 % 532 %
555 \newcommand{\@release}{} 533 \newcommand{\@release}{}
563 % author's name. This can be used to format them differently, which 541 % author's name. This can be used to format them differently, which
564 % is a good thing. 542 % is a good thing.
565 % 543 %
566 \newcommand{\@authoraddress}{} 544 \newcommand{\@authoraddress}{}
567 \newcommand{\authoraddress}[1]{\renewcommand{\@authoraddress}{#1}} 545 \newcommand{\authoraddress}[1]{\renewcommand{\@authoraddress}{#1}}
568
569 % Change the title page to look a bit better, and fit in with the
570 % fncychap ``Bjarne'' style a bit better.
571 %
572 \renewcommand{\maketitle}{%
573 \begin{titlepage}%
574 \let\footnotesize\small
575 \let\footnoterule\relax
576 \@ifundefined{ChTitleVar}{}{%
577 \mghrulefill{\RW}}%
578 \@ifundefined{pdfinfo}{}{
579 \pdfinfo
580 author {\@author}
581 title {\@title}
582 }
583 \begin{flushright}%
584 {\rm\Huge\HeaderFamily \@title \par}%
585 {\em\LARGE\HeaderFamily \@release \par}
586 \vfill
587 {\LARGE\HeaderFamily \@author \par}
588 \vfill\vfill
589 {\large
590 \@date \par
591 \vskip 3em
592 \@authoraddress \par
593 }%
594 \end{flushright}%\par
595 \@thanks
596 \end{titlepage}%
597 \setcounter{footnote}{0}%
598 \let\thanks\relax\let\maketitle\relax
599 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}
600 }
601 546
602 % This sets up the fancy chapter headings that make the documents look 547 % This sets up the fancy chapter headings that make the documents look
603 % at least a little better than the usual LaTeX output. 548 % at least a little better than the usual LaTeX output.
604 % 549 %
605 \@ifundefined{ChTitleVar}{}{ 550 \@ifundefined{ChTitleVar}{}{
614 \fi 559 \fi
615 \interlinepenalty\@M 560 \interlinepenalty\@M
616 \DOTI{#1} 561 \DOTI{#1}
617 } 562 }
618 } 563 }
619 \typeout{Using fancy chapter headings.}
620 } 564 }
621 565
622 % Tell TeX about pathological hyphenation cases: 566 % Tell TeX about pathological hyphenation cases:
623 \hyphenation{Base-HTTP-Re-quest-Hand-ler} 567 \hyphenation{Base-HTTP-Re-quest-Hand-ler}