comparison Doc/texinputs/python.sty @ 16966:38e17a089492 legacy-trunk

Label classes and exceptions explicitly in the documentation (for their *desc environments).
author Fred Drake <fdrake@acm.org>
date Fri, 02 Mar 2001 18:57:05 +0000
parents 64545c986b98
children 4622af4da9e2
comparison
equal deleted inserted replaced
16965:ec29895ee40c 16966:38e17a089492
114 % Style parameters and macros used by most documents here 114 % Style parameters and macros used by most documents here
115 \raggedbottom 115 \raggedbottom
116 \sloppy 116 \sloppy
117 \parindent = 0mm 117 \parindent = 0mm
118 \parskip = 2mm 118 \parskip = 2mm
119 \hbadness = 5000 % don't print trivial gripes 119 \hbadness = 5000 % don't print trivial gripes
120 120
121 \pagestyle{empty} % start this way; change for 121 \pagestyle{empty} % start this way; change for
122 \pagenumbering{roman} % ToC & chapters 122 \pagenumbering{roman} % ToC & chapters
123 123
124 % Use this to set the font family for headers and other decor: 124 % Use this to set the font family for headers and other decor:
125 \newcommand{\py@HeaderFamily}{\sffamily} 125 \newcommand{\py@HeaderFamily}{\sffamily}
126 126
127 % Redefine the 'normal' header/footer style when using "fancyhdr" package: 127 % Redefine the 'normal' header/footer style when using "fancyhdr" package:
596 % \begin{classdesc}{name}{constructor args} 596 % \begin{classdesc}{name}{constructor args}
597 \newenvironment{classdesc}[2]{ 597 \newenvironment{classdesc}[2]{
598 % Using \renewcommand doesn't work for this, for unknown reasons: 598 % Using \renewcommand doesn't work for this, for unknown reasons:
599 \global\def\py@thisclass{#1} 599 \global\def\py@thisclass{#1}
600 \begin{fulllineitems} 600 \begin{fulllineitems}
601 \item[\code{\bfcode{#1}(\py@varvars{#2})}% 601 \item[\strong{class }\code{\bfcode{#1}(\py@varvars{#2})}%
602 \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}] 602 \index{#1@{\py@idxcode{#1}} (class in \py@thismodule)}]
603 }{\end{fulllineitems}} 603 }{\end{fulllineitems}}
604 604
605 % \begin{excclassdesc}{name}{constructor args} 605 % \begin{excclassdesc}{name}{constructor args}
606 % but indexes as an exception 606 % but indexes as an exception
607 \newenvironment{excclassdesc}[2]{ 607 \newenvironment{excclassdesc}[2]{
608 % Using \renewcommand doesn't work for this, for unknown reasons: 608 % Using \renewcommand doesn't work for this, for unknown reasons:
609 \global\def\py@thisclass{#1} 609 \global\def\py@thisclass{#1}
610 \begin{fulllineitems} 610 \begin{fulllineitems}
611 \item[\code{\bfcode{#1}(\py@varvars{#2})}% 611 \item[\strong{exception }\code{\bfcode{#1}(\py@varvars{#2})}%
612 \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}] 612 \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}]
613 }{\end{fulllineitems}} 613 }{\end{fulllineitems}}
614 614
615 615
616 \let\py@classbadkey=\@undefined 616 \let\py@classbadkey=\@undefined
676 % For exceptions: -------------------------------------------------------- 676 % For exceptions: --------------------------------------------------------
677 % \begin{excdesc}{name} 677 % \begin{excdesc}{name}
678 % -- for constructor information, use excclassdesc instead 678 % -- for constructor information, use excclassdesc instead
679 \newenvironment{excdesc}[1]{ 679 \newenvironment{excdesc}[1]{
680 \begin{fulllineitems} 680 \begin{fulllineitems}
681 \item[\bfcode{#1}% 681 \item[\strong{exception }\bfcode{#1}%
682 \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}] 682 \index{#1@{\py@idxcode{#1}} (exception in \py@thismodule)}]
683 }{\end{fulllineitems}} 683 }{\end{fulllineitems}}
684 684
685 % Module data or constants: ---------------------------------------------- 685 % Module data or constants: ----------------------------------------------
686 % \begin{datadesc}{name} 686 % \begin{datadesc}{name}
751 \@ifundefined{pdfannotlink}{ 751 \@ifundefined{pdfannotlink}{
752 \newcommand{\py@url}[1]{\mbox{\small\textsf{#1}}} 752 \newcommand{\py@url}[1]{\mbox{\small\textsf{#1}}}
753 }{ 753 }{
754 \newcommand{\py@url}[1]{{% 754 \newcommand{\py@url}[1]{{%
755 \pdfannotlink attr{/Border [0 0 0]} user{/S /URI /URI (#1)}% 755 \pdfannotlink attr{/Border [0 0 0]} user{/S /URI /URI (#1)}%
756 \py@LinkColor% color of the link text 756 \py@LinkColor% color of the link text
757 \mbox{\small\textsf{#1}}% 757 \mbox{\small\textsf{#1}}%
758 \py@NormalColor% Turn it back off; these are declarative 758 \py@NormalColor% Turn it back off; these are declarative
759 \pdfendlink}% and don't appear bound to the current 759 \pdfendlink}% and don't appear bound to the current
760 }% formatting "box". 760 }% formatting "box".
761 } 761 }
762 \let\url=\py@url 762 \let\url=\py@url
763 \newcommand{\email}[1]{{\small\textsf{#1}}} 763 \newcommand{\email}[1]{{\small\textsf{#1}}}
764 \newcommand{\newsgroup}[1]{{\small\textsf{#1}}} 764 \newcommand{\newsgroup}[1]{{\small\textsf{#1}}}
765 765
789 \newcommand{\class}[1]{\texttt{#1}} 789 \newcommand{\class}[1]{\texttt{#1}}
790 \newcommand{\function}[1]{\texttt{#1}} 790 \newcommand{\function}[1]{\texttt{#1}}
791 \newcommand{\member}[1]{\texttt{#1}} 791 \newcommand{\member}[1]{\texttt{#1}}
792 \newcommand{\method}[1]{\texttt{#1}} 792 \newcommand{\method}[1]{\texttt{#1}}
793 793
794 \newcommand{\pytype}[1]{#1} % built-in Python type 794 \newcommand{\pytype}[1]{#1} % built-in Python type
795 795
796 \newcommand{\cfunction}[1]{\texttt{#1}} 796 \newcommand{\cfunction}[1]{\texttt{#1}}
797 \newcommand{\ctype}[1]{\texttt{#1}} % C struct or typedef name 797 \newcommand{\ctype}[1]{\texttt{#1}} % C struct or typedef name
798 \newcommand{\cdata}[1]{\texttt{#1}} % C variable, typically global 798 \newcommand{\cdata}[1]{\texttt{#1}} % C variable, typically global
799 799
800 \newcommand{\mimetype}[1]{{\small\textsf{#1}}} 800 \newcommand{\mimetype}[1]{{\small\textsf{#1}}}
801 % The \! is a "negative thin space" in math mode. 801 % The \! is a "negative thin space" in math mode.
802 \newcommand{\regexp}[1]{% 802 \newcommand{\regexp}[1]{%
803 {\tiny$^{^\lceil}\!\!$% 803 {\tiny$^{^\lceil}\!\!$%
807 \newcommand{\envvar}[1]{% 807 \newcommand{\envvar}[1]{%
808 #1% 808 #1%
809 \index{#1@{#1}}% 809 \index{#1@{#1}}%
810 \index{environment variables!{#1}}% 810 \index{environment variables!{#1}}%
811 } 811 }
812 \newcommand{\makevar}[1]{#1} % variable in a Makefile 812 \newcommand{\makevar}[1]{#1} % variable in a Makefile
813 \newcommand{\character}[1]{\samp{#1}} 813 \newcommand{\character}[1]{\samp{#1}}
814 814
815 % constants defined in Python modules or C headers, not language constants: 815 % constants defined in Python modules or C headers, not language constants:
816 \newcommand{\constant}[1]{\code{#1}} % manifest constant, not syntactic 816 \newcommand{\constant}[1]{\code{#1}} % manifest constant, not syntactic
817 817
818 \newcommand{\manpage}[2]{{\emph{#1}(#2)}} 818 \newcommand{\manpage}[2]{{\emph{#1}(#2)}}
819 \newcommand{\pep}[1]{PEP #1\index{Python Enhancement Proposals!PEP #1}} 819 \newcommand{\pep}[1]{PEP #1\index{Python Enhancement Proposals!PEP #1}}
820 \newcommand{\rfc}[1]{RFC #1\index{RFC!RFC #1}} 820 \newcommand{\rfc}[1]{RFC #1\index{RFC!RFC #1}}
821 \newcommand{\program}[1]{\strong{#1}} 821 \newcommand{\program}[1]{\strong{#1}}