Oops; file copy error somewhere along the way....

This commit is contained in:
Fred Drake 1998-03-06 22:33:06 +00:00
parent 47e09c43fd
commit 6663b22198
1 changed files with 71 additions and 86 deletions

View File

@ -1,5 +1,5 @@
% %
% myformat.sty for the Python docummentation [works only with with Latex2e] % python.sty for the Python docummentation [works only with with Latex2e]
% %
\NeedsTeXFormat{LaTeX2e}[1995/12/01] \NeedsTeXFormat{LaTeX2e}[1995/12/01]
@ -13,7 +13,7 @@
\RequirePackage[Bjarne]{fncychap}\typeout{Using fancy chapter headings.} \RequirePackage[Bjarne]{fncychap}\typeout{Using fancy chapter headings.}
% for PDF output, use maximal compression % for PDF output, use maximal compression
\@ifundefined{pdfannotlink}{ \@@ifundefined{pdfannotlink}{
\let\LinkColor=\relax \let\LinkColor=\relax
\let\NormalColor=\relax \let\NormalColor=\relax
}{% }{%
@ -52,18 +52,18 @@
% %
% This is *heavily* based on the hyperref package. % This is *heavily* based on the hyperref package.
% %
\def\@begindvi{% \def\@@begindvi{%
\unvbox \@begindvibox \unvbox \@@begindvibox
\@hyperfixhead \@@hyperfixhead
} }
\def\hyperpageanchor{\pdfdest name{page.\thepage}} \def\hyperpageanchor{\pdfdest name{page.\thepage}}
\let\HYPERPAGEANCHOR\hyperpageanchor \let\HYPERPAGEANCHOR\hyperpageanchor
\def\@hyperfixhead{% \def\@@hyperfixhead{%
\let\H@old@thehead\@thehead \let\H@@old@@thehead\@@thehead
\gdef\@foo{\pdfdest name{page.\thepage} fit}% \gdef\@@foo{\pdfdest name{page.\thepage} fit}%
\expandafter\ifx\expandafter\@empty\H@old@thehead \expandafter\ifx\expandafter\@@empty\H@@old@@thehead
\def\H@old@thehead{\hfil}\fi \def\H@@old@@thehead{\hfil}\fi
\def\@thehead{\@foo\relax\H@old@thehead}% \def\@@thehead{\@@foo\relax\H@@old@@thehead}%
} }
} }
@ -73,7 +73,7 @@
\advance \topmargin by -\headsep \advance \topmargin by -\headsep
% attempt to work a little better for A4 users % attempt to work a little better for A4 users
\@ifundefined{paperheight}{ \@@ifundefined{paperheight}{
\textheight 9in \textheight 9in
}{ }{
\textheight \paperheight \textheight \paperheight
@ -84,7 +84,7 @@
\evensidemargin \oddsidemargin \evensidemargin \oddsidemargin
\marginparwidth 0.5in \marginparwidth 0.5in
\@ifundefined{paperwidth}{ \@@ifundefined{paperwidth}{
\textwidth 6.5in \textwidth 6.5in
}{ }{
\textwidth \paperwidth \textwidth \paperwidth
@ -107,7 +107,7 @@
\newcommand{\HeaderFamily}{\sffamily} \newcommand{\HeaderFamily}{\sffamily}
% Redefine the 'normal' header/footer style when using "fancyhdr" package: % Redefine the 'normal' header/footer style when using "fancyhdr" package:
\@ifundefined{fancyhf}{}{ \@@ifundefined{fancyhf}{}{
% Use \pagestyle{normal} as the primary pagestyle for text. % Use \pagestyle{normal} as the primary pagestyle for text.
\fancypagestyle{normal}{ \fancypagestyle{normal}{
\fancyhf{} \fancyhf{}
@ -129,13 +129,13 @@
% Redefine \cleardoublepage so that the blank page between chapters % Redefine \cleardoublepage so that the blank page between chapters
% gets the plain style and not the fancy style. This is described % gets the plain style and not the fancy style. This is described
% in the documentation for the fancyhdr package by Piet von Oostrum. % in the documentation for the fancyhdr package by Piet von Oostrum.
\@ifundefined{chapter}{}{ \@@ifundefined{chapter}{}{
\renewcommand{\cleardoublepage}{ \renewcommand{\cleardoublepage}{
\clearpage\if@openright \ifodd\c@page\else \clearpage\if@@openright \ifodd\c@@page\else
\hbox{} \hbox{}
\thispagestyle{plain} \thispagestyle{plain}
\newpage \newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi \if@@twocolumn\hbox{}\newpage\fi\fi\fi
} }
} }
} }
@ -181,26 +181,26 @@
} }
% Augment the sectioning commands used to get our own font family in place: % Augment the sectioning commands used to get our own font family in place:
\renewcommand{\section}{\@startsection {section}{1}{\z@}% \renewcommand{\section}{\@@startsection {section}{1}{\z@@}%
{-3.5ex \@plus -1ex \@minus -.2ex}% {-3.5ex \@@plus -1ex \@@minus -.2ex}%
{2.3ex \@plus.2ex}% {2.3ex \@@plus.2ex}%
{\reset@font\Large\HeaderFamily}} {\reset@@font\Large\HeaderFamily}}
\renewcommand{\subsection}{\@startsection{subsection}{2}{\z@}% \renewcommand{\subsection}{\@@startsection{subsection}{2}{\z@@}%
{-3.25ex\@plus -1ex \@minus -.2ex}% {-3.25ex\@@plus -1ex \@@minus -.2ex}%
{1.5ex \@plus .2ex}% {1.5ex \@@plus .2ex}%
{\reset@font\large\HeaderFamily}} {\reset@@font\large\HeaderFamily}}
\renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}% \renewcommand{\subsubsection}{\@@startsection{subsubsection}{3}{\z@@}%
{-3.25ex\@plus -1ex \@minus -.2ex}% {-3.25ex\@@plus -1ex \@@minus -.2ex}%
{1.5ex \@plus .2ex}% {1.5ex \@@plus .2ex}%
{\reset@font\normalsize\HeaderFamily}} {\reset@@font\normalsize\HeaderFamily}}
\renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}% \renewcommand{\paragraph}{\@@startsection{paragraph}{4}{\z@@}%
{3.25ex \@plus1ex \@minus.2ex}% {3.25ex \@@plus1ex \@@minus.2ex}%
{-1em}% {-1em}%
{\reset@font\normalsize\HeaderFamily}} {\reset@@font\normalsize\HeaderFamily}}
\renewcommand{\subparagraph}{\@startsection{subparagraph}{5}{\parindent}% \renewcommand{\subparagraph}{\@@startsection{subparagraph}{5}{\parindent}%
{3.25ex \@plus1ex \@minus .2ex}% {3.25ex \@@plus1ex \@@minus .2ex}%
{-1em}% {-1em}%
{\reset@font\normalsize\HeaderFamily}} {\reset@@font\normalsize\HeaderFamily}}
% Underscore hack (only act like subscript operator if in math mode) % Underscore hack (only act like subscript operator if in math mode)
@ -255,30 +255,30 @@
% Command to generate a reference to a function, statement, keyword, % Command to generate a reference to a function, statement, keyword,
% operator. % operator.
\newcommand{\stindex}[1]{\indexii{statement}{#1@{\idxcode{#1}}}} \newcommand{\stindex}[1]{\indexii{statement}{#1@@{\idxcode{#1}}}}
\newcommand{\opindex}[1]{\indexii{operator}{#1@{\idxcode{#1}}}} \newcommand{\opindex}[1]{\indexii{operator}{#1@@{\idxcode{#1}}}}
\newcommand{\exindex}[1]{\indexii{exception}{#1@{\idxcode{#1}}}} \newcommand{\exindex}[1]{\indexii{exception}{#1@@{\idxcode{#1}}}}
\newcommand{\obindex}[1]{\indexii{object}{#1}} \newcommand{\obindex}[1]{\indexii{object}{#1}}
\newcommand{\bifuncindex}[1]{\index{#1@{\idxcode{#1()}} (built-in function)}} \newcommand{\bifuncindex}[1]{\index{#1@@{\idxcode{#1()}} (built-in function)}}
% Add an index entry for a module % Add an index entry for a module
\newcommand{\refmodule}[2]{\index{#1@{\idxcode{#1}} (#2module)}} \newcommand{\refmodule}[2]{\index{#1@@{\idxcode{#1}} (#2module)}}
\newcommand{\refmodindex}[1]{\refmodule{#1}{}} \newcommand{\refmodindex}[1]{\refmodule{#1}{}}
\newcommand{\refbimodindex}[1]{\refmodule{#1}{built-in }} \newcommand{\refbimodindex}[1]{\refmodule{#1}{built-in }}
\newcommand{\refexmodindex}[1]{\refmodule{#1}{extension }} \newcommand{\refexmodindex}[1]{\refmodule{#1}{extension }}
\newcommand{\refstmodindex}[1]{\refmodule{#1}{standard }} \newcommand{\refstmodindex}[1]{\refmodule{#1}{standard }}
% support for the module index % support for the module index
\if@usemoduleindex \if@@usemoduleindex
\newwrite\modindexfile \newwrite\modindexfile
\openout\modindexfile=mod\jobname.idx \openout\modindexfile=mod\jobname.idx
\fi \fi
% Add the defining entry for a module % Add the defining entry for a module
\newcommand{\defmodindex}[2]{% \newcommand{\defmodindex}[2]{%
\index{#1@{\idxcode{#1}} (#2module)|textbf}% \index{#1@@{\idxcode{#1}} (#2module)|textbf}%
\setindexsubitem{(in module #1)}% \setindexsubitem{(in module #1)}%
\if@usemoduleindex% \if@@usemoduleindex%
\write\modindexfile{#1 \thepage}% \write\modindexfile{#1 \thepage}%
\fi} \fi}
@ -291,9 +291,9 @@
\newcommand{\exmodindex}[1]{\defmodindex{#1}{extension }} \newcommand{\exmodindex}[1]{\defmodindex{#1}{extension }}
% Additional string for an index entry % Additional string for an index entry
\newcommand{\index@subitem}{} \newcommand{\index@@subitem}{}
\newcommand{\setindexsubitem}[1]{\renewcommand{\index@subitem}{#1}} \newcommand{\setindexsubitem}[1]{\renewcommand{\index@@subitem}{#1}}
\newcommand{\ttindex}[1]{\index{#1@{\idxcode{#1}} \index@subitem}} \newcommand{\ttindex}[1]{\index{#1@@{\idxcode{#1}} \index@@subitem}}
% {fulllineitems} is used in one place in libregex.tex, but is really for % {fulllineitems} is used in one place in libregex.tex, but is really for
@ -314,13 +314,13 @@
\newenvironment{cfuncdesc}[3]{% \newenvironment{cfuncdesc}[3]{%
\begin{fulllineitems}% \begin{fulllineitems}%
\item[\code{#1 \bfcode{#2}(\varvars{#3})}]% \item[\code{#1 \bfcode{#2}(\varvars{#3})}]%
\index{#2@{\idxcode{#2()}}}% \index{#2@@{\idxcode{#2()}}}%
}{\end{fulllineitems}} }{\end{fulllineitems}}
\newenvironment{cvardesc}[2]{% \newenvironment{cvardesc}[2]{%
\begin{fulllineitems}% \begin{fulllineitems}%
\item[\code{#1 \bfcode{#2}}]% \item[\code{#1 \bfcode{#2}}]%
\index{#2@{\idxcode{#2}}}% \index{#2@@{\idxcode{#2}}}%
}{\end{fulllineitems}} }{\end{fulllineitems}}
\newenvironment{ctypedesc}[1]{% \newenvironment{ctypedesc}[1]{%
@ -389,7 +389,7 @@
\newcommand{\NULL}{\code{NULL}} \newcommand{\NULL}{\code{NULL}}
% code is the most difficult one... % code is the most difficult one...
\newcommand{\code}[1]{{\@vobeyspaces\@noligs\def\{{\char`\{}\def\}{\char`\}}\def\~{\char`\~}\def\^{\char`\^}\def\e{\char`\\}\def\${\char`\$}\def\#{\char`\#}\def\&{\char`\&}\def\%{\char`\%}% \newcommand{\code}[1]{{\@@vobeyspaces\@@noligs\def\{{\char`\{}\def\}{\char`\}}\def\~{\char`\~}\def\^{\char`\^}\def\e{\char`\\}\def\${\char`\$}\def\#{\char`\#}\def\&{\char`\&}\def\%{\char`\%}%
\mbox{\codefont{#1}}}} \mbox{\codefont{#1}}}}
\newcommand{\bfcode}[1]{\code{\bfseries#1}} % bold-faced code font \newcommand{\bfcode}[1]{\code{\bfseries#1}} % bold-faced code font
@ -408,7 +408,7 @@
% Use this def/redef approach for \url{} since hyperref defined this already, % Use this def/redef approach for \url{} since hyperref defined this already,
% but only if we actually used hyperref: % but only if we actually used hyperref:
\@ifundefined{pdfannotlink}{% \@@ifundefined{pdfannotlink}{%
\newcommand{\pythonurl}[1]{\mbox{\small\textsf{#1}}}% \newcommand{\pythonurl}[1]{\mbox{\small\textsf{#1}}}%
}{ }{
\newcommand{\pythonurl}[1]{{% \newcommand{\pythonurl}[1]{{%
@ -491,8 +491,8 @@
} }
\newcommand{\itemnewline}[1]{% \newcommand{\itemnewline}[1]{%
\@tempdima\linewidth% \@@tempdima\linewidth%
\advance\@tempdima \leftmargin\makebox[\@tempdima][l]{#1}% \advance\@@tempdima \leftmargin\makebox[\@@tempdima][l]{#1}%
} }
\newcommand{\sectcode}[1]{{\sectcodefont{#1}}} \newcommand{\sectcode}[1]{{\sectcodefont{#1}}}
@ -508,20 +508,20 @@
% %
% \end{seealso} % \end{seealso}
\newif\if@keyedmodule\@keyedmodulefalse \newif\if@@keyedmodule\@@keyedmodulefalse
\newcommand{\@modulebadkey}{{--just-some-junk--}} \newcommand{\@@modulebadkey}{{--just-some-junk--}}
\@ifundefined{pdfannotlink}{% \@@ifundefined{pdfannotlink}{%
\newcommand{\seemodule}[3][\@modulebadkey]{% \newcommand{\seemodule}[3][\@@modulebadkey]{%
\ifx\@modulebadkey#1\def\@modulekey{#2}\else\def\@modulekey{#1}\fi% \ifx\@@modulebadkey#1\def\@@modulekey{#2}\else\def\@@modulekey{#1}\fi%
\ref{module-\@modulekey}:\quad % \ref{module-\@@modulekey}:\quad %
Module \module{#2}% Module \module{#2}%
\quad (#3)% \quad (#3)%
} }
}{\newcommand{\seemodule}[3][\@modulebadkey]{% }{\newcommand{\seemodule}[3][\@@modulebadkey]{%
\ifx\@modulebadkey#1\def\@modulekey{#2}\else\def\@modulekey{#1}\fi% \ifx\@@modulebadkey#1\def\@@modulekey{#2}\else\def\@@modulekey{#1}\fi%
\ref{module-\@modulekey}:\quad % \ref{module-\@@modulekey}:\quad %
{\pdfannotlink attr{/Border [0 0 0]} goto name{label.module-\@modulekey}% {\pdfannotlink attr{/Border [0 0 0]} goto name{label.module-\@@modulekey}%
\LinkColor Module \module{#2} \NormalColor% \LinkColor Module \module{#2} \NormalColor%
\pdfendlink% \pdfendlink%
}% }%
@ -530,21 +530,6 @@
} }
\newenvironment{seealso}[0]{ \newenvironment{seealso}[0]{
\strong{See Also:}\par \strong{See Also:}\par
% These should only be defined within the {seealso} environment:
%\def\see@module##1##2{\ref{module-##1}:\quad Module \module{##1}\quad (##2)}
% \def\@seemodule[##1]##2##3{%
% \ref{module-##2}:\quad %
% \@ifundefined{pdfannotlink}{%
% Module \module{##2}%
% }{\if@keyedmodule\@keyedmodulefalse\fi%
% {\pdfannotlink attr{/Border [0 0 0]} goto name{module.##1}%
% \LinkColor Module \module{##2}\NormalColor\pdfendlink}%
% }%
% \quad (##3)%
% }
% \def\seemodule{%
% \@ifnextchar [\@seemodule{\@keyedmoduletrue \@seemodule[]}%
% }
\def\seetext##1{\par{##1}} \def\seetext##1{\par{##1}}
}{\par} }{\par}
@ -564,34 +549,34 @@
% \date{}. This allows the date to reflect the document's date and % \date{}. This allows the date to reflect the document's date and
% release to specify the Python release that is documented. % release to specify the Python release that is documented.
% %
\newcommand{\@release}{} \newcommand{\@@release}{}
\newcommand{\version}{} \newcommand{\version}{}
\newcommand{\releasename}{Release} \newcommand{\releasename}{Release}
\newcommand{\release}[1]{% \newcommand{\release}[1]{%
\renewcommand{\@release}{\releasename\space\version}% \renewcommand{\@@release}{\releasename\space\version}%
\renewcommand{\version}{#1}} \renewcommand{\version}{#1}}
% Allow specification of the author's address separately from the % Allow specification of the author's address separately from the
% author's name. This can be used to format them differently, which % author's name. This can be used to format them differently, which
% is a good thing. % is a good thing.
% %
\newcommand{\@authoraddress}{} \newcommand{\@@authoraddress}{}
\newcommand{\authoraddress}[1]{\renewcommand{\@authoraddress}{#1}} \newcommand{\authoraddress}[1]{\renewcommand{\@@authoraddress}{#1}}
% This sets up the fancy chapter headings that make the documents look % This sets up the fancy chapter headings that make the documents look
% at least a little better than the usual LaTeX output. % at least a little better than the usual LaTeX output.
% %
\@ifundefined{ChTitleVar}{}{ \@@ifundefined{ChTitleVar}{}{
\ChNameVar{\raggedleft\normalsize\HeaderFamily} \ChNameVar{\raggedleft\normalsize\HeaderFamily}
\ChNumVar{\raggedleft \bfseries\Large\HeaderFamily} \ChNumVar{\raggedleft \bfseries\Large\HeaderFamily}
\ChTitleVar{\raggedleft \rm\Huge\HeaderFamily} \ChTitleVar{\raggedleft \rm\Huge\HeaderFamily}
% This creates chapter heads without the leading \vspace*{}: % This creates chapter heads without the leading \vspace*{}:
\def\@makechapterhead#1{% \def\@@makechapterhead#1{%
{\parindent \z@ \raggedright \normalfont {\parindent \z@@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne \ifnum \c@@secnumdepth >\m@@ne
\DOCH \DOCH
\fi \fi
\interlinepenalty\@M \interlinepenalty\@@M
\DOTI{#1} \DOTI{#1}
} }
} }