Package epydoc :: Package docwriter :: Module latex_sty
[hide private]
[frames] | no frames]

Source Code for Module epydoc.docwriter.latex_sty

   1  # -*- latex -*- 
   2  # 
   3  # epydoc.css: LaTeX stylesheets (*.sty) for epydoc's LaTeX writer 
   4  # 
   5  # $Id: html_css.py 1717 2008-02-14 22:21:41Z edloper $ 
   6  # 
   7   
   8  """ 
   9  LaTeX stylesheets (*.sty) for epydoc's LaTeX writer. 
  10  """ 
  11   
  12  #: A disclaimer that is appended to the bottom of the BASE and 
  13  #: BOXES stylesheets. 
  14  NIST_DISCLAIMER = r""" 
  15  % This style file is a derivative work, based on a public domain style 
  16  % file that was originally developed at the National Institute of 
  17  % Standards and Technology by employees of the Federal Government in the 
  18  % course of their official duties.  NIST assumes no responsibility 
  19  % whatsoever for its use by other parties, and makes no guarantees, 
  20  % expressed or implied, about its quality, reliability, or any other 
  21  % characteristic. 
  22  """ 
  23   
  24  ###################################################################### 
  25  ###################################################################### 
  26  BASE = r""" 
  27  % epydoc-base.sty 
  28  % 
  29  % Authors: Jonathan Guyer <guyer@nist.gov> 
  30  %          Edward Loper <edloper@seas.upenn.edu> 
  31  % URL: <http://epydoc.sf.net> 
  32  % 
  33  % This LaTeX stylesheet defines the basic commands that are used by 
  34  % epydoc's latex writer (epydoc.docwriter.latex).  For more 
  35  % information, see the epydoc webpage.  This stylesheet accepts the 
  36  % following options: 
  37  % 
  38  %   - index: Include an index of defined objects. 
  39  %   - hyperlink: Create hyperlinks with the hyperref package. 
  40  % 
  41  % $Id:$ 
  42   
  43  \NeedsTeXFormat{LaTeX2e}% 
  44  \ProvidesClass{epydoc-base}[2008/02/26 v3.0.1 Epydoc Python Documentation] 
  45   
  46  % ====================================================================== 
  47  % Options 
  48   
  49  % These two packages are used to process options: 
  50  \RequirePackage{ifthen} 
  51  \RequirePackage{xkeyval} 
  52   
  53  % Define an option 'index' that sets the boolean value \@doIndex 
  54  \newif\if@doIndex 
  55  \@doIndexfalse 
  56  \DeclareOptionX{index}{\@doIndextrue} 
  57   
  58  % Define an option 'hyperlink' that sets the boolean value \@docHyperlink 
  59  \newif\if@doHyperlink 
  60  \@doHyperlinkfalse 
  61  \DeclareOptionX{hyperlink}{\@doHyperlinktrue} 
  62   
  63  % Pass the 'title' & 'creator' options to the hyperref package. 
  64  \DeclareOptionX{title}[]{\PassOptionsToPackage{pdftitle={#1}}{hyperref}} 
  65  \DeclareOptionX{creator}[]{\PassOptionsToPackage{pdfcreator={#1}}{hyperref}} 
  66   
  67  % Process the options list. 
  68  \ProcessOptionsX\relax 
  69   
  70  % ====================================================================== 
  71  % Package Requirements 
  72   
  73  \RequirePackage{alltt, boxedminipage} 
  74  \RequirePackage{multirow, amssymb} 
  75  \RequirePackage[headings]{fullpage} 
  76  \RequirePackage[usenames]{color} 
  77  \RequirePackage{graphicx} 
  78   
  79  \@ifclassloaded{memoir}{% 
  80      \RequirePackage[other,notbib]{tocbibind} 
  81  }{% 
  82      \if@doIndex 
  83          \RequirePackage{makeidx} 
  84      \fi 
  85      \RequirePackage{parskip} 
  86      \RequirePackage{fancyhdr} 
  87      \RequirePackage[other]{tocbibind} 
  88      \pagestyle{fancy} 
  89  } 
  90   
  91  \if@doIndex 
  92      \makeindex 
  93  \fi 
  94   
  95  \ifx\pdfoutput\undefined\newcommand{\driver}{dvips} 
  96  \else\ifnum\pdfoutput=1\newcommand{\driver}{pdftex} 
  97  \else\newcommand{\driver}{dvips}\fi\fi 
  98   
  99  \RequirePackage[\driver, pagebackref,  
 100      bookmarks=true, bookmarksopen=false, pdfpagemode=UseOutlines,  
 101      colorlinks=true, linkcolor=black, anchorcolor=black, citecolor=black,  
 102      filecolor=black, menucolor=black, pagecolor=black, urlcolor=UrlColor] 
 103      {hyperref} 
 104   
 105   
 106  % ====================================================================== 
 107  % General Formatting 
 108   
 109  % Setting this will make us less likely to get overfull hboxes: 
 110  %\setlength{\emergencystretch}{1in} 
 111   
 112  % Separate paragraphs by a blank line (do not indent them).  We define 
 113  % a new length variable. \EpydocParskip, for the paragraph-skip length. 
 114  % This needs to be assigned to \parskip here as well as inside several 
 115  % environments that reset \parskip (such as minipages). 
 116  \newlength{\EpydocParskip} 
 117  \newlength{\EpydocMetadataLongListParskip} 
 118  \setlength{\EpydocParskip}{0.6\baselineskip} 
 119  \setlength{\EpydocMetadataLongListParskip}{0.4\baselineskip} 
 120  \setlength{\parskip}{\EpydocParskip} 
 121  \setlength{\parindent}{0ex} 
 122   
 123  % Fix the heading position -- without this, the headings generated 
 124  % by the fancyheadings package sometimes overlap the text. 
 125  \setlength{\headheight}{16pt} 
 126  \setlength{\headsep}{24pt} 
 127  \setlength{\topmargin}{-\headsep} 
 128   
 129  % Display the section & subsection names in a header. 
 130  \renewcommand{\sectionmark}[1]{\markboth{#1}{}} 
 131  \renewcommand{\subsectionmark}[1]{\markright{#1}} 
 132   
 133  % Create a 'base class' length named EpydocBCL for use in base trees. 
 134  \newlength{\EpydocBCL} % base class length, for base trees. 
 135   
 136  % In xkeyval arguments, we're not allowed to use \par.  But we *are* 
 137  % allowed to use a command that evaluates to \par, so define such a 
 138  % command. 
 139  \newcommand{\EpydocPar}{\par} 
 140   
 141  % ====================================================================== 
 142  % Sections inside docstring 
 143   
 144  % The following commands are used to mark section headers within 
 145  % docstrings. 
 146  \newcommand\EpydocUserSection[1]{% 
 147    \par\vspace{3ex}{\large\bf #1 }\par\vspace{1.4ex}} 
 148  \newcommand\EpydocUserSubsection[1]{% 
 149    \par\vspace{2.8ex}{\bf #1 }\par\vspace{1.2ex}} 
 150  \newcommand\EpydocUserSubsubsection[1]{% 
 151    \par\vspace{2.6ex}{\bf\it #1 }\par\vspace{1.0ex}} 
 152   
 153  % ====================================================================== 
 154  % Hyperlinks & Crossreferences 
 155   
 156  % The \EpydocHypertarget command is used to mark targets that hyperlinks 
 157  % may point to.  It takes two arguments: a target label, and text 
 158  % contents.  (In some cases, the text contents will be empty.)  Target 
 159  % labels are formed by replacing '.'s in the name with ':'s.  The 
 160  % default stylesheet creates a \label for the target label, and displays 
 161  % the text. 
 162  \newcommand{\EpydocHypertarget}[2]{\label{#1}#2} 
 163   
 164  % The \EpydocHyperlink command is used to create a link to a given target. 
 165  % It takes two arguments: a target label, and text contents.  The 
 166  % default stylesheet just displays the text contents. 
 167  \newcommand{\EpydocHyperlink}[2]{#2} 
 168   
 169  % The \CrossRef command creates a cross-reference to a given target, 
 170  % including a pageref.  It takes one argument, a target label. 
 171  \newcommand{\CrossRef}[1]{\textit{(Section \ref{#1}, p.~\pageref{#1})}} 
 172   
 173  % If the [hyperlink] option is turned on, then enable hyperlinking. 
 174  \if@doHyperlink 
 175    \renewcommand{\EpydocHyperlink}[2]{\hyperlink{#1}{#2}} 
 176    \renewcommand{\EpydocHypertarget}[2]{\label{#1}\hypertarget{#1}{#2}} 
 177  \fi 
 178   
 179  % ====================================================================== 
 180  % Index Terms 
 181   
 182  % The \EpydocIndex command is used to mark items that should be included 
 183  % in the index.  It takes three arguments.  The first argument is the 
 184  % item's case-normalized name; this is typically discarded, and is 
 185  % simply used to ensure the proper (i.e., case-insensitive) sort order 
 186  % in the index.  The second argument is the item's name; and the 
 187  % third item is the item's "kind".  "kind" can be Package, Script, Module, 
 188  % Class, Class Method, Static Method, Method, Function, or Variable. 
 189  % This command is used inside of the \index{...} command. 
 190  \newcommand{\EpydocIndex}[3]{% 
 191      #2 % 
 192      \ifthenelse{\equal{#3}{}}{}{\textit{(#3)}}} 
 193       
 194  % ====================================================================== 
 195  % Descriptions (docstring contents) 
 196   
 197  % All rendered markup derived from a docstring is wrapped in this 
 198  % environment.  By default, it simply sets the \parskip length 
 199  % to \EpydocParskip (in case an enclosing environment had reset 
 200  % it to its default value). 
 201  \newenvironment{EpydocDescription}{% 
 202      \setlength{\parskip}{\EpydocParskip}% 
 203      \ignorespaces}{\ignorespacesafterend} 
 204   
 205  % This environment is used to mark the description for a class 
 206  % (which comes from the function's docstring). 
 207  \newenvironment{EpydocClassDescription}{% 
 208      \ignorespaces}{\ignorespacesafterend} 
 209   
 210  % This environment is used to mark the description for a module 
 211  % (which comes from the function's docstring). 
 212  \newenvironment{EpydocModuleDescription}{% 
 213      \ignorespaces}{\ignorespacesafterend} 
 214   
 215  % ====================================================================== 
 216  % Python Source Code Syntax Highlighting. 
 217   
 218  % Color constants. 
 219  \definecolor{py@keywordcolor}{rgb}{1,0.45882,0} 
 220  \definecolor{py@stringcolor}{rgb}{0,0.666666,0} 
 221  \definecolor{py@commentcolor}{rgb}{1,0,0} 
 222  \definecolor{py@ps1color}{rgb}{0.60784,0,0} 
 223  \definecolor{py@ps2color}{rgb}{0.60784,0,1} 
 224  \definecolor{py@inputcolor}{rgb}{0,0,0} 
 225  \definecolor{py@outputcolor}{rgb}{0,0,1} 
 226  \definecolor{py@exceptcolor}{rgb}{1,0,0} 
 227  \definecolor{py@defnamecolor}{rgb}{1,0.5,0.5} 
 228  \definecolor{py@builtincolor}{rgb}{0.58039,0,0.58039} 
 229  \definecolor{py@identifiercolor}{rgb}{0,0,0} 
 230  \definecolor{py@linenumcolor}{rgb}{0.4,0.4,0.4} 
 231  \definecolor{py@inputcolor}{rgb}{0,0,0} 
 232   
 233  % Syntax Highlighting Commands 
 234  \newcommand{\pysrcprompt}[1]{\textcolor{py@ps1color}{\small\textbf{#1}}} 
 235  \newcommand{\pysrcmore}[1]{\textcolor{py@ps2color}{\small\textbf{#1}}} 
 236  \newcommand{\pysrckeyword}[1]{\textcolor{py@keywordcolor}{\small\textbf{#1}}} 
 237  \newcommand{\pysrcbuiltin}[1]{\textcolor{py@builtincolor}{\small\textbf{#1}}} 
 238  \newcommand{\pysrcstring}[1]{\textcolor{py@stringcolor}{\small\textbf{#1}}} 
 239  \newcommand{\pysrcdefname}[1]{\textcolor{py@defnamecolor}{\small\textbf{#1}}} 
 240  \newcommand{\pysrcother}[1]{\small\textbf{#1}} 
 241  \newcommand{\pysrccomment}[1]{\textcolor{py@commentcolor}{\small\textbf{#1}}} 
 242  \newcommand{\pysrcoutput}[1]{\textcolor{py@outputcolor}{\small\textbf{#1}}} 
 243  \newcommand{\pysrcexcept}[1]{\textcolor{py@exceptcolor}{\small\textbf{#1}}} 
 244   
 245  % ====================================================================== 
 246  % Grouping 
 247   
 248  % This command is used to display group headers for objects that are in 
 249  % the same group (as specified by the epydoc @group field).  It is used 
 250  % within the Epydoc*List environments.  The definition provided here is 
 251  % the default definition, but several of the Epydoc*List environments 
 252  % use \renewcommand to provide definitions that are appropriate for the 
 253  % style of that environment. 
 254  \newcommand{\EpydocGroup}[1]{\par{\large #1}\par} 
 255   
 256  % ====================================================================== 
 257  % Inheritance 
 258   
 259  % This command is used to display a list of objects that were inherited 
 260  % from a base class.  It expects two arguments: the base class name, 
 261  % and the list of inherited objects.  The definition provided here is 
 262  % the default definition, but several of the Epydoc*List environments 
 263  % use \renewcommand to provide definitions that are appropriate for the 
 264  % style of that environment. 
 265  \newcommand{\EpydocInheritanceList}[2]{% 
 266      \textbf{Inherited from {#1}:} #2\par} 
 267       
 268  % ====================================================================== 
 269  % Submodule List 
 270   
 271  % This list environment is used to list the submodules that are defined 
 272  % by a module.  Nested submodules are displayed using nested 
 273  % EpydocModuleList environments.  If the modules are divided into 
 274  % groups (with the epydoc @group field), then groups are displayed 
 275  % using the \EpydocGroup command. 
 276   
 277  \newenvironment{EpydocModuleList}{% 
 278      \renewcommand{\EpydocGroup}[1]{% 
 279          \vspace{\EpydocParskip}\item[]\hspace{-\labelwidth}% 
 280          \textbf{\large ##1}}% 
 281      \begin{itemize}% 
 282      \setlength{\parskip}{0ex}}% 
 283      {\end{itemize}} 
 284   
 285  % Usage: \EpydocModule{name={...}, summary={...}, crossref={...}} 
 286  \define@cmdkeys[Epydoc]{module}{name,summary,crossref} 
 287  \newcommand{\EpydocModule}[1]{{% 
 288      \setkeys[Epydoc]{module}{#1}% 
 289      \item \textbf{\cmdEpydoc@module@name}:% 
 290      \@ifundefined{cmdEpydoc@module@summary}{}{% 
 291          \ \cmdEpydoc@module@summary}% 
 292      \@ifundefined{cmdEpydoc@module@crossref}{}{% 
 293          \ \cmdEpydoc@module@crossref}}} 
 294   
 295  % ====================================================================== 
 296  % Class List 
 297  % 
 298  % These environments are *only* used if the --list-classes-separately 
 299  % option is used. 
 300   
 301  % This list environment is used to list the classes that are defined  
 302  % by a module. 
 303  \newenvironment{EpydocClassList}{% 
 304      \renewcommand{\EpydocGroup}[1]{% 
 305          \vspace{\EpydocParskip}\item[]\hspace{-\labelwidth}% 
 306          \textbf{\large ##1}}% 
 307      \begin{itemize}% 
 308      \setlength{\parskip}{0ex}}% 
 309      {\end{itemize}} 
 310   
 311  % Usage: \EpydocClass{name={...}, summary={...}, crossref={...}} 
 312  \define@cmdkeys[Epydoc]{class}{name,summary,crossref} 
 313  \newcommand{\EpydocClass}[1]{{% 
 314      \setkeys[Epydoc]{class}{#1}% 
 315      \item \textbf{\cmdEpydoc@class@name}:% 
 316      \@ifundefined{cmdEpydoc@class@summary}{}{% 
 317          \ \cmdEpydoc@class@summary}% 
 318      \@ifundefined{cmdEpydoc@class@crossref}{}{% 
 319          \ \cmdEpydoc@class@crossref}}} 
 320   
 321  % ====================================================================== 
 322  % Function Lists 
 323   
 324  % The EpydocFunctionList environment is used to describe functions 
 325  % and methods.  It contains one \EpydocFunction command for each 
 326  % function or method.  This command takes eight required arguments: 
 327  % 
 328  %   - The function's signature: an EpydocFunctionSignature environment 
 329  %     specifying the signature for the function. 
 330  % 
 331  %   - The function's description (from the docstring) 
 332  %  
 333  %   - The function's parameters: An EpydocFunctionParameters list  
 334  %     environment providing descriptions of the function's parameters. 
 335  %     (from the epydoc @param, @arg, @kwarg, @vararg, @type fields) 
 336  % 
 337  %   - The function's return description (from the epydoc @rerturns field) 
 338  % 
 339  %   - The function's return type (from the epydoc @rtype field) 
 340  % 
 341  %   - The function's exceptions: An EpydocFunctionRaises list 
 342  %     environment describing exceptions that the function may raise 
 343  %     (from the epydoc @raises field) 
 344  % 
 345  %   - The function's override: An EpydocFunctionOverrides command 
 346  %     describing the method that this function overrides (if any) 
 347  % 
 348  %   - The function's metadata: Zero or more EpydocMetadata* 
 349  %     commands/environments, taken from metadata fields (eg @author) 
 350  % 
 351  % All arguments except for the first (the signature) may be empty. 
 352  % 
 353  \define@cmdkeys[Epydoc]{function}{signature,description,parameters, 
 354                                    returndescr,returntype,raises, 
 355                                    overrides,metadata} 
 356  \newenvironment{EpydocFunctionList}{% 
 357      \newcommand{\EpydocFunction}[1]{{% 
 358          \setkeys[Epydoc]{function}{##1}% 
 359          {\Large\raggedright\cmdEpydoc@function@signature\par} 
 360          \begin{quote}% 
 361              \setlength{\parskip}{\EpydocParskip}% 
 362              \@ifundefined{cmdEpydoc@function@description}{}{ 
 363                  \par\cmdEpydoc@function@description} 
 364              \@ifundefined{cmdEpydoc@function@parameters}{}{ 
 365                  \par\cmdEpydoc@function@parameters} 
 366              \@ifundefined{cmdEpydoc@function@returndescr}{}{ 
 367                  \par \textbf{Returns:} \cmdEpydoc@function@returndescr} 
 368              \@ifundefined{cmdEpydoc@function@returntype}{}{ 
 369                  \par \textbf{Return Type:} \cmdEpydoc@function@returntype} 
 370              \@ifundefined{cmdEpydoc@function@raises}{}{ 
 371                  \par\cmdEpydoc@function@raises} 
 372              \@ifundefined{cmdEpydoc@function@overrides}{}{ 
 373                  \par\cmdEpydoc@function@overrides} 
 374              \@ifundefined{cmdEpydoc@function@metadata}{}{ 
 375                  \ifx\cmdEpydoc@function@metadata\empty\else 
 376                      \par\cmdEpydoc@function@metadata\fi} 
 377          \end{quote}\par}}} 
 378    {} 
 379   
 380  % The EpydocFunctionSignature environment is used to display a 
 381  % function's signature.  It expects one argument, the function's 
 382  % name.  The body of the environment contains the parameter list. 
 383  % The following commands are used in the parameter list, to mark 
 384  % individual parameters: 
 385  % 
 386  %   - \Param: Takes one required argument (the parameter name) and 
 387  %     one optional argument (the defaultt value). 
 388  %   - \VarArg: Takes one argument (the varargs parameter name) 
 389  %   - \KWArg: Takes one argument (the keyword parameter name) 
 390  %   - \GenericArg: Takes no arguments (this is used for '...', e.g. 
 391  %     when the signature is unknown). 
 392  %   - \TupleArg: Used inside of the \Param command, to mark 
 393  %     argument tuples.  Individual elements of the argument tuple 
 394  %     are separated by the \and command. 
 395  %  
 396  % Parameters are separated by the \and command. 
 397  \newenvironment{EpydocFunctionSignature}[1]{% 
 398      \newcommand{\and}{, }% 
 399      \newcommand{\VarArg}[1]{*\textit{##1}}% 
 400      \newcommand{\GenericArg}{\textit{\ldots}}% 
 401      \newcommand{\KWArg}[1]{**\textit{##1}}% 
 402      \newcommand{\TupleArg}[1]{(##1)}% 
 403      \newcommand{\Param}[2][]{% 
 404          \textit{##2}% 
 405          \ifthenelse{\equal{##1}{}}{}{=\texttt{##1}}}% 
 406      \@hangfrom{\textbf{#1}(}% 
 407      }{)} 
 408   
 409  % The EpydocFunctionParameters environment is used to display  
 410  % descriptions for the parameters that a function can take. 
 411  % (From epydoc fields: @param, @arg, @kwarg, @vararg, @type) 
 412  \newenvironment{EpydocFunctionParameters}[1]{% 
 413      \textbf{Parameters} 
 414      \vspace{-\EpydocParskip} 
 415      \begin{quote} 
 416      \begin{list}{}{% 
 417        \renewcommand{\makelabel}[1]{\texttt{##1:}\hfil}% 
 418        \settowidth{\labelwidth}{\texttt{#1:}}% 
 419        \setlength{\leftmargin}{\labelsep}% 
 420        \addtolength{\leftmargin}{\labelwidth}}}% 
 421      {\end{list} 
 422      \end{quote} 
 423      } 
 424   
 425  % This environment is used to display descriptions of exceptions 
 426  % that can be raised by a function.  (From epydoc field: @raise) 
 427  \newenvironment{EpydocFunctionRaises}{% 
 428      \renewcommand*{\descriptionlabel}[1]{\hspace\labelsep 
 429         \normalfont\itshape ##1} 
 430      \textbf{Raises} 
 431      \vspace{-\EpydocParskip}% 
 432      \begin{quote}% 
 433          \begin{description}% 
 434      } 
 435      {\end{description} 
 436      \end{quote} 
 437      } 
 438   
 439  % This environment is used when a method overrides a base class 
 440  % method, to display the name of the overridden method. 
 441  \newcommand{\EpydocFunctionOverrides}[2][0]{% 
 442      \textbf{Overrides:} #2 % 
 443      \ifthenelse{#1=1}{\textit{(inherited documentation)}{}}\par} 
 444   
 445  % ====================================================================== 
 446  % Variable Lists 
 447  % 
 448  % There are three separate variable list environments: 
 449  %   - EpydocVariableList............ for a module's variables 
 450  %   - EpydocInstanceVariableList.... for a class's instance variables 
 451  %   - EpydocClassVariableList....... for a class's class variables 
 452   
 453  % The EpydocVariableList environment is used to describe module 
 454  % variables.  It contains one \EpydocVariable command for each 
 455  % variable.  This command takes four required arguments: 
 456  %  
 457  %   - The variable's name 
 458  %   - The variable's description (from the docstring) 
 459  %   - The variable's type (from the epydoc @type field) 
 460  %   - The variable's value 
 461  % 
 462  % If any of these arguments is not available, then the empty 
 463  % string will be used. 
 464  \define@cmdkeys[Epydoc]{variable}{name,description,type,value,metadata} 
 465  \newenvironment{EpydocVariableList}{% 
 466      \newcommand{\EpydocVariable}[1]{{% 
 467          \setkeys[Epydoc]{variable}{##1}% 
 468          {\Large\raggedright\cmdEpydoc@variable@name\par} 
 469          \begin{quote} 
 470              \setlength{\parskip}{\EpydocParskip}% 
 471              \@ifundefined{cmdEpydoc@variable@description}{}{% 
 472                  \par\cmdEpydoc@variable@description}% 
 473              \@ifundefined{cmdEpydoc@variable@type}{}{% 
 474                  \par\textbf{Type:} \cmdEpydoc@variable@type}% 
 475              \@ifundefined{cmdEpydoc@variable@value}{}{% 
 476                  \par\textbf{Value:} \cmdEpydoc@variable@value}% 
 477              \@ifundefined{cmdEpydoc@variable@metadata}{}{% 
 478                  \ifx\cmdEpydoc@variable@metadata\empty\else 
 479                      \par\cmdEpydoc@variable@metadata\fi}% 
 480          \end{quote}\par}}} 
 481    {} 
 482   
 483  % The EpydocClassVariableList environment is used the same way as 
 484  % the EpydocVariableList environment (shown above). 
 485  \newenvironment{EpydocClassVariableList}{% 
 486      \begin{EpydocVariableList}} 
 487      {\end{EpydocVariableList}} 
 488   
 489  % The EpydocClassVariableList environment is used the same way as 
 490  % the EpydocVariableList environment (shown above). 
 491  \newenvironment{EpydocInstanceVariableList}{% 
 492      \begin{EpydocVariableList}} 
 493      {\end{EpydocVariableList}} 
 494   
 495  % ====================================================================== 
 496  % Property Lists 
 497   
 498  % The EpydocPropertyList environment is used to describe class 
 499  % properties.  It contains one \EpydocProperty command for each 
 500  % property.  This command takes six required arguments: 
 501  %  
 502  %   - The property's name 
 503  %   - The property's description (from the docstring) 
 504  %   - The property's type (from the epydoc @type field) 
 505  %   - The property's fget function 
 506  %   - The property's fset function 
 507  %   - The property's fdel function 
 508  % 
 509  % If any of these arguments is not available, then the empty 
 510  % string will be used. 
 511  \define@cmdkeys[Epydoc]{property}{name,description,type,fget, 
 512                                    fset,fdel,metadata} 
 513  \newenvironment{EpydocPropertyList}{% 
 514      \newcommand{\EpydocProperty}[1]{{% 
 515          \setkeys[Epydoc]{property}{##1}% 
 516          {\Large\raggedright\cmdEpydoc@property@name\par} 
 517          \begin{quote} 
 518              \setlength{\parskip}{\EpydocParskip}% 
 519              \@ifundefined{cmdEpydoc@property@description}{}{ 
 520                  \par\cmdEpydoc@property@description} 
 521              \@ifundefined{cmdEpydoc@property@type}{}{ 
 522                  \par\textbf{Type:} \cmdEpydoc@property@type} 
 523              \@ifundefined{cmdEpydoc@property@fget}{}{ 
 524                  \par\textbf{Get:} \cmdEpydoc@property@fget} 
 525              \@ifundefined{cmdEpydoc@property@fset}{}{ 
 526                  \par\textbf{Set:} \cmdEpydoc@property@fset} 
 527              \@ifundefined{cmdEpydoc@property@fdel}{}{ 
 528                  \par\textbf{Delete:} \cmdEpydoc@property@fdel} 
 529              \@ifundefined{cmdEpydoc@property@metadata}{}{ 
 530                  \ifx\cmdEpydoc@property@metadata\empty\else 
 531                      \par\cmdEpydoc@property@metadata\fi} 
 532          \end{quote}\par}}} 
 533    {} 
 534   
 535  % ====================================================================== 
 536  % Metadata 
 537   
 538  % This command is used to display a metadata field with a single value 
 539  \newcommand{\EpydocMetadataSingleValue}[2]{% 
 540      \par 
 541      \begin{list}{}{\itemindent-\leftmargin} 
 542      \item \textbf{#1:} #2 
 543      \end{list}\par\ignorespaces} 
 544   
 545  % This environment is used to display a metadata field with multiple 
 546  % values when the field declares that short=True; i.e., that multiple 
 547  % values should be combined into a single comma-delimited list. 
 548  \newenvironment{EpydocMetadataShortList}[1]{% 
 549      \newcommand{\and}{, }% 
 550      \par 
 551      \begin{list}{}{\itemindent-\leftmargin} 
 552      \item \textbf{#1:} \ignorespaces} 
 553      {\end{list}\ignorespacesafterend\par} 
 554   
 555  % This list environment is used to display a metadata field with 
 556  % multiple values when the field declares that short=False; i.e., that 
 557  % multiple values should be listed separately in a bulleted list. 
 558  \newenvironment{EpydocMetadataLongList}[1]{% 
 559      \par 
 560      \textbf{#1:} 
 561      \setlength{\parskip}{0ex} 
 562          \begin{itemize} 
 563              \setlength{\parskip}{\EpydocMetadataLongListParskip} 
 564              \ignorespaces} 
 565      {\end{itemize}\ignorespacesafterend\par} 
 566   
 567  % ====================================================================== 
 568  % reStructuredText Admonitions 
 569   
 570  % This environment is used to display reStructuredText admonitions, 
 571  % such as ``..warning::'' and ``..note::''. 
 572  \newenvironment{reSTadmonition}[1][]{% 
 573      \begin{center}\begin{sffamily}% 
 574          \begin{lrbox}{\@tempboxa}% 
 575              \begin{minipage}{\admonitionwidth}% 
 576                  \textbf{\large #1}% 
 577                  \vspace{2mm}}% 
 578      {\end{minipage}% 
 579      \end{lrbox}% 
 580      \fbox{\usebox{\@tempboxa}}% 
 581      \end{sffamily}% 
 582      \end{center}} 
 583   
 584  % ====================================================================== 
 585  % Name Formatting     
 586  % 
 587  % This section defines the EpydocDottedName command, which is used to 
 588  % display the names of Python objects. 
 589   
 590  % The \EpydocDottedName command adds a possible break-point after every 
 591  % period in the given string.  It no longer escapes characters such as 
 592  % underscore, since this interfered with the hyperref package; instead, 
 593  % epydoc is responsible for escaping them.  E.g., correct usage for a 
 594  % name with an underscore is \EpydocDottedName{some\_name}. 
 595  \newcommand\EpydocDottedName[1]{ 
 596    \Epydoc@DottedName #1.@} 
 597   
 598  % This helper function performs the work of \EpydocDottedName. It 
 599  % scans forward, looking for a period, and putting all text up to the 
 600  % period into #1.  The single character after the period is put in 
 601  % #2.  This function then checks if #2 is '@', indicating that we're 
 602  % done, or some other character, indicating that we should continue. 
 603  % Note that \ifx tests character codes; and that when '@' appears 
 604  % in user code, it gets the character code 'other', but when it 
 605  % appears here, it gets the character code 'letter'. 
 606  \def\Epydoc@DottedName#1.#2{% 
 607    \ifx#2@\relax #1\else  
 608      #1\discretionary{.}{}{.}% 
 609      \expandafter\expandafter\expandafter\Epydoc@DottedName 
 610      \expandafter #2\fi% 
 611    } 
 612   
 613  """+NIST_DISCLAIMER 
 614  ###################################################################### 
 615  ###################################################################### 
 616   
 617  ###################################################################### 
 618  ###################################################################### 
 619  BOXES = r""" 
 620  % epydoc-boxes.sty 
 621  % 
 622  % Authors: Jonathan Guyer <guyer@nist.gov> 
 623  %          Edward Loper <edloper@seas.upenn.edu> 
 624  % URL: <http://epydoc.sf.net> 
 625  % 
 626  % This LaTeX stylesheet (nearly) replicates the LaTeX output style 
 627  % generated by epydoc 3.0.  Function lists are displayed using 
 628  % a boxedminipage for each function.  Variable and Property lists 
 629  % are displayed using a longtable, with a row for each object. 
 630  % 
 631  % $Id:$ 
 632  \NeedsTeXFormat{LaTeX2e} 
 633  \ProvidesClass{epydoc-boxes}[2008/02/26 v3.0.1 Epydoc Python Documentation] 
 634  % Pass options to the epydoc base package. 
 635  \RequirePackage{xkeyval} 
 636  \DeclareOptionX*{\PassOptionsToPackage{\CurrentOption}{epydoc-base}} 
 637  \ProcessOptionsX\relax 
 638  % Load the base epydoc package 
 639  \RequirePackage{epydoc-base} 
 640   
 641  % Use longtable for variable & property lists. 
 642  \RequirePackage{longtable} 
 643   
 644  % Double the standard size boxedminipage outlines. 
 645  \setlength{\fboxrule}{2\fboxrule} 
 646   
 647  % Set the width of the variable name cells in the variable & property 
 648  % tables. 
 649  \newlength{\EpydocVariableWidth} 
 650  \setlength{\EpydocVariableWidth}{.3\textwidth} 
 651   
 652  % ====================================================================== 
 653  % Function Lists 
 654   
 655  % Put the function inside a boxedminipage.  Use a horizontal rule to 
 656  % separate the signature from the description elements.  Implementation 
 657  % note: the \@EpydocSeparator command adds a horizontal rule the first 
 658  % time it is called, and does nothing when called after that. 
 659  \renewenvironment{EpydocFunctionList}{% 
 660      \def\@EpydocSeparator{% 
 661         \vspace{-2\EpydocParskip} 
 662         \rule{\dimexpr \textwidth-2\fboxsep}{0.5\fboxrule} 
 663         \aftergroup\def\aftergroup\@EpydocSeparator% 
 664               \aftergroup{\aftergroup}}% 
 665      \newcommand{\EpydocFunction}[1]{{% 
 666          \setkeys[Epydoc]{function}{##1}% 
 667          \begin{boxedminipage}{\dimexpr \textwidth-2\fboxsep} 
 668              {\Large\raggedright\cmdEpydoc@function@signature\par} 
 669              \setlength{\parskip}{\EpydocParskip} 
 670              \@ifundefined{cmdEpydoc@function@description}{}{% 
 671                  {\@EpydocSeparator}% 
 672                  \par\cmdEpydoc@function@description}% 
 673              \@ifundefined{cmdEpydoc@function@parameters}{}{% 
 674                  {\@EpydocSeparator}% 
 675                  \par\cmdEpydoc@function@parameters}% 
 676              \@ifundefined{cmdEpydoc@function@returntype}{ 
 677                  \@ifundefined{cmdEpydoc@function@returndescr}{}{ 
 678                      {\@EpydocSeparator}% 
 679                      \par\textbf{Return Value}% 
 680                      \par\vspace{-\EpydocParskip}% 
 681                      \begin{quote}\cmdEpydoc@function@returndescr\end{quote}}% 
 682              }{ 
 683                  {\@EpydocSeparator}% 
 684                  \par\textbf{Return Value}% 
 685                  \par\vspace{-\EpydocParskip}% 
 686                  \begin{quote}% 
 687                    \@ifundefined{cmdEpydoc@function@returndescr}{ 
 688                        \textit{\cmdEpydoc@function@returntype}% 
 689                    }{% 
 690                        \cmdEpydoc@function@returndescr% 
 691                          \textit{(type=\cmdEpydoc@function@returntype)}}% 
 692                  \end{quote}% 
 693              } 
 694              \@ifundefined{cmdEpydoc@function@raises}{}{% 
 695                  {\@EpydocSeparator}% 
 696                  \par\cmdEpydoc@function@raises}% 
 697              \@ifundefined{cmdEpydoc@function@overrides}{}{% 
 698                  {\@EpydocSeparator}% 
 699                  \par\cmdEpydoc@function@overrides}% 
 700              \@ifundefined{cmdEpydoc@function@metadata}{}{% 
 701                  \ifx\cmdEpydoc@property@metadata\empty\else 
 702                      {\@EpydocSeparator}% 
 703                      \par\cmdEpydoc@function@metadata% 
 704                  \fi}% 
 705          \end{boxedminipage}\par}}} 
 706    {} 
 707   
 708  % ====================================================================== 
 709  % Multi-Page List (used to define EpydocVariableList etc) 
 710   
 711  % [xx] \textwidth is not the right size for the multicolumn.. 
 712   
 713  % Define a base environment that we will use to put variable & 
 714  % property lists in a longtable.  This environment sets up the 
 715  % longtable environment, and redefines the \EpydocGroup and 
 716  % \EpydocInheritanceList commands to add a row to the table. 
 717  \newenvironment{@EpydocGeneralList}{% 
 718      \renewcommand{\EpydocGroup}[1]{% 
 719          \multicolumn{2}{@{\vrule width \fboxrule \hspace \tabcolsep}l 
 720                          @{\hspace \tabcolsep \vrule width \fboxrule}} 
 721              {\textbf{\textit{##1}}} \\ 
 722          \hline}% 
 723      \renewcommand{\EpydocInheritanceList}[2]{% 
 724          \multicolumn{2}{@{\vrule width \fboxrule \hspace \tabcolsep} 
 725                          p{\dimexpr \textwidth -4\tabcolsep-7pt} 
 726                          @{\hspace \tabcolsep \vrule width \fboxrule}} 
 727              {\raggedright\textbf{Inherited from {##1}:\\##2}} \\ 
 728          \hline}% 
 729      \setlength{\doublerulesep}{0pt} 
 730      \begin{longtable}[l]{@{\vrule width \fboxrule \hspace \tabcolsep} 
 731                           p{\EpydocVariableWidth}| 
 732                           p{\dimexpr \textwidth% 
 733                                  -4\tabcolsep-7pt 
 734                                  -\EpydocVariableWidth} 
 735                           @{\hspace \tabcolsep \vrule width \fboxrule}} 
 736      % Set up the headers & footer (this makes the table span 
 737      % multiple pages in a happy way). 
 738      \hline \hline \rule{0pt}{\baselineskip}  
 739      \centering \Large \textbf{Name} & 
 740      \centering \Large \textbf{Description}  
 741      \tabularnewline 
 742      \hline \hline  
 743      \endhead% 
 744      \hline\hline\multicolumn{2}{r}{% 
 745          \small\textit{continued on next page}}\\\endfoot% 
 746      \hline\hline 
 747      \endlastfoot} 
 748      {\end{longtable}} 
 749   
 750  % ====================================================================== 
 751  % Variable Lists 
 752   
 753  \renewenvironment{EpydocVariableList}{% 
 754      \newcommand{\EpydocVariable}[1]{{% 
 755          \setkeys[Epydoc]{variable}{##1}% 
 756          \raggedright\cmdEpydoc@variable@name &% 
 757          \setkeys[Epydoc]{variable}{##1}% 
 758          \setlength{\parskip}{\EpydocParskip}\raggedright% 
 759          \@ifundefined{cmdEpydoc@variable@description}{}{% 
 760              \cmdEpydoc@variable@description\relax}% 
 761          \@ifundefined{cmdEpydoc@variable@value}{}{% 
 762              \@ifundefined{cmdEpydoc@variable@description}{}{\par}% 
 763              \textbf{Value:} \texttt{\cmdEpydoc@variable@value}}% 
 764          \@ifundefined{cmdEpydoc@variable@type}{}{% 
 765              \@ifundefined{cmdEpydoc@variable@description}{% 
 766                  \@ifundefined{cmdEpydoc@variable@value}{}{ }}{ }% 
 767              \textit{(type=\texttt{\cmdEpydoc@variable@type})}}% 
 768          \tabularnewline 
 769          \hline}}% 
 770      \begin{@EpydocGeneralList}% 
 771      } 
 772      {\end{@EpydocGeneralList}} 
 773   
 774  % By default, EpydocClassVariableList & EpydocInstanceVariableList are  
 775  % just aliases for EpydocVaribleList. 
 776   
 777  % ====================================================================== 
 778  % Property Lists 
 779   
 780  % Implementation node: \@EpydocSeparator evaluates to nothing on 
 781  % the first use, and to a paragraph break on subsequent uses. 
 782  \renewenvironment{EpydocPropertyList}{% 
 783      \def\@EpydocSeparator{% 
 784         \aftergroup\def\aftergroup\@EpydocSeparator\aftergroup{% 
 785         \aftergroup\par% 
 786         \aftergroup}}% 
 787      \newcommand{\EpydocProperty}[1]{{% 
 788          \setkeys[Epydoc]{property}{##1}% 
 789          \raggedright\cmdEpydoc@property@name & % 
 790          \setkeys[Epydoc]{property}{##1}% 
 791          \setlength{\parskip}{\EpydocParskip}\raggedright% 
 792          \@ifundefined{cmdEpydoc@property@description}{}{% 
 793              {\@EpydocSeparator}% 
 794              \cmdEpydoc@property@description\relax}% 
 795          \@ifundefined{cmdEpydoc@property@type}{}{% 
 796              {\@EpydocSeparator}% 
 797              \textbf{Type:} \cmdEpydoc@property@type\relax}% 
 798          \@ifundefined{cmdEpydoc@property@fget}{}{% 
 799              {\@EpydocSeparator}% 
 800              \textbf{Get:} \cmdEpydoc@property@fget\relax}% 
 801          \@ifundefined{cmdEpydoc@property@fset}{}{% 
 802              {\@EpydocSeparator}% 
 803              \textbf{Set:} \cmdEpydoc@property@fset\relax}% 
 804          \@ifundefined{cmdEpydoc@property@fdel}{}{% 
 805              {\@EpydocSeparator}% 
 806              \textbf{Delete:} \cmdEpydoc@property@fdel\relax}% 
 807          \tabularnewline 
 808          \hline}} 
 809      \begin{@EpydocGeneralList}} 
 810      {\end{@EpydocGeneralList}} 
 811  """+NIST_DISCLAIMER 
 812  ###################################################################### 
 813  ###################################################################### 
 814   
 815   
 816  ###################################################################### 
 817  ###################################################################### 
 818  SHADED = r""" 
 819  % epydoc-shaded.sty 
 820  % 
 821  % Author: Edward Loper <edloper@seas.upenn.edu> 
 822  % URL: <http://epydoc.sf.net> 
 823  % 
 824  % This LaTeX stylesheet for epydoc's output uses shaded boxes to 
 825  % display the function, variable, and property lists.  Each 
 826  % object's name (or signature) is displayed in a lightly shaded 
 827  % box, and is immediately followed by a shaded and indented box  
 828  % containing a description of that object: 
 829  % 
 830  %         +-------------------------------------------+ 
 831  %         | object's name                             | 
 832  %         +-------------------------------------------+ 
 833  %             | description of the object             | 
 834  %             | ...                                   | 
 835  %             +---------------------------------------+ 
 836  % 
 837  % $Id:$ 
 838  \NeedsTeXFormat{LaTeX2e} 
 839  \ProvidesClass{epydoc-shaded}[2008/02/26 v3.0.1 Epydoc Python Documentation] 
 840  % Pass options to the epydoc base package. 
 841  \RequirePackage{xkeyval} 
 842  \DeclareOptionX*{\PassOptionsToPackage{\CurrentOption}{epydoc-base}} 
 843  \ProcessOptionsX\relax 
 844  % Load the base epydoc package 
 845  \RequirePackage{epydoc-base} 
 846   
 847  % ====================================================================== 
 848  % Customization hooks 
 849   
 850  % These colors  
 851  \definecolor{EpydocNameColor}{gray}{0.95} 
 852  \definecolor{EpydocDetailsColor}{gray}{0.90} 
 853  \definecolor{EpydocValueColor}{gray}{0.85} 
 854  \definecolor{EpydocGroupColor}{gray}{0.8} 
 855  \definecolor{EpydocInheritanceListColor}{gray}{0.95} 
 856   
 857  % This length controls how tightly function, variable, and property 
 858  % entries are spaced. 
 859  \newlength{\EpydocListsep} 
 860  \setlength{\EpydocListsep}{\baselineskip} 
 861   
 862  % This length is used to dedent the section headings. 
 863  \newlength{\EpydocSectionHeaderDedent} 
 864  \setlength{\EpydocSectionHeaderDedent}{1cm} 
 865   
 866  % ====================================================================== 
 867  % Colored minipage 
 868   
 869  % adapted from <http://www.texnik.de/color/color.phtml> for colored  
 870  % paragraph boxes 
 871  \newcommand{\cmcolor}{} 
 872  \newenvironment{cminipage}[2][white]{% 
 873      \renewcommand{\cmcolor}{#1}% 
 874      \begin{lrbox}{\@tempboxa}% 
 875        \begin{minipage}{#2}% 
 876        \setlength{\parskip}{\EpydocParskip}% 
 877    }{% 
 878        \end{minipage}% 
 879      \end{lrbox}% 
 880      \colorbox{\cmcolor}{\usebox{\@tempboxa}}} 
 881   
 882  % ====================================================================== 
 883  % Redefinitions 
 884   
 885  \renewenvironment{EpydocFunctionList}{% 
 886    \setlength{\parskip}{\EpydocListsep}% 
 887    \newcommand{\EpydocFunction}[1]{{ 
 888      \setkeys[Epydoc]{function}{##1}% 
 889      % Decide whether to include a 'details' block 
 890      \newif\ifEpydoc@details% 
 891      \@ifundefined{cmdEpydoc@function@description}{}{\Epydoc@detailstrue}% 
 892      \@ifundefined{cmdEpydoc@function@parameters}{}{\Epydoc@detailstrue}% 
 893      \@ifundefined{cmdEpydoc@function@returndescr}{}{\Epydoc@detailstrue}% 
 894      \@ifundefined{cmdEpydoc@function@returntype}{}{\Epydoc@detailstrue}% 
 895      \@ifundefined{cmdEpydoc@function@raises}{}{\Epydoc@detailstrue}% 
 896      \@ifundefined{cmdEpydoc@function@overrides}{}{\Epydoc@detailstrue}% 
 897      \@ifundefined{cmdEpydoc@function@metadata}{}{\Epydoc@detailstrue}% 
 898      % Add some vertical space. 
 899      \par 
 900      % Put a box around the whole thing, so the signature line and the 
 901      % body don't get split across pages. 
 902      \begin{minipage}{\textwidth}% 
 903        \setlength{\parskip}{-1pt}\raggedleft% 
 904        % Add the function signature in a gray95 box. 
 905        \begin{cminipage}[EpydocNameColor]% 
 906                         {\dimexpr \textwidth-2\fboxsep} 
 907          \Large\raggedright\cmdEpydoc@function@signature 
 908        \end{cminipage}\par 
 909        % Add the details in a gray90 box. 
 910        \ifEpydoc@details 
 911          \begin{cminipage}[EpydocDetailsColor]% 
 912                           {\dimexpr 0.95\linewidth-2\fboxsep}% 
 913            \@ifundefined{cmdEpydoc@function@description}{}{% 
 914                \par\cmdEpydoc@function@description}% 
 915            \@ifundefined{cmdEpydoc@function@parameters}{}{% 
 916                \par\cmdEpydoc@function@parameters}% 
 917            \@ifundefined{cmdEpydoc@function@returntype}{ 
 918                \@ifundefined{cmdEpydoc@function@returndescr}{}{ 
 919                    \par\textbf{Return Value}% 
 920                    \par\vspace{-\EpydocParskip}% 
 921                    \begin{quote}\cmdEpydoc@function@returndescr% 
 922                    \end{quote}}% 
 923            }{ 
 924                \par\textbf{Return Value}% 
 925                \par\vspace{-\EpydocParskip}% 
 926                \begin{quote}% 
 927                  \@ifundefined{cmdEpydoc@function@returndescr}{ 
 928                      \textit{\cmdEpydoc@function@returntype}% 
 929                  }{% 
 930                      \cmdEpydoc@function@returndescr% 
 931                        \textit{(type=\cmdEpydoc@function@returntype)}}% 
 932                \end{quote}}% 
 933            \@ifundefined{cmdEpydoc@function@raises}{}{% 
 934                \par\cmdEpydoc@function@raises}% 
 935            \@ifundefined{cmdEpydoc@function@overrides}{}{% 
 936                \par\cmdEpydoc@function@overrides}% 
 937            \@ifundefined{cmdEpydoc@function@metadata}{}{% 
 938                \par\cmdEpydoc@function@metadata}% 
 939          \end{cminipage}\par 
 940        \fi% 
 941     \end{minipage}\par}}} 
 942    {} 
 943   
 944  \newlength{\EpydocValueWidth} 
 945  \renewenvironment{EpydocVariableList}{% 
 946    \setlength{\parskip}{\EpydocListsep}% 
 947    \newcommand{\EpydocVariable}[1]{{ 
 948      \setkeys[Epydoc]{variable}{##1}% 
 949      % Decide whether to include a 'details' block 
 950      \newif\ifEpydoc@details% 
 951      \@ifundefined{cmdEpydoc@variable@description}{}{\Epydoc@detailstrue}% 
 952      \@ifundefined{cmdEpydoc@variable@value}{}{\Epydoc@detailstrue}% 
 953      \@ifundefined{cmdEpydoc@variable@type}{}{\Epydoc@detailstrue}% 
 954      % Put a box around the whole thing, so the variable's name line  
 955      % and the body don't get split across pages. 
 956      \begin{minipage}{\linewidth}% 
 957        \setlength{\parskip}{-1pt}\raggedleft% 
 958        % Add the variable name in a gray95 box. 
 959        \begin{cminipage}[EpydocNameColor]% 
 960                         {\dimexpr \textwidth-2\fboxsep} 
 961          \Large \bfseries \cmdEpydoc@variable@name% 
 962        \end{cminipage}\par 
 963        % Add the details in a gray90 box. 
 964        \ifEpydoc@details 
 965          \begin{cminipage}[EpydocDetailsColor]% 
 966                           {\dimexpr 0.95\linewidth-2\fboxsep}% 
 967            \setlength{\parskip}{\EpydocParskip}% 
 968            \@ifundefined{cmdEpydoc@variable@description}{}{% 
 969                \par\cmdEpydoc@variable@description}% 
 970            \@ifundefined{cmdEpydoc@variable@type}{}{% 
 971                \par\textbf{Type:} \texttt{\cmdEpydoc@variable@type}}% 
 972            \@ifundefined{cmdEpydoc@variable@value}{}{% 
 973              \settowidth{\EpydocValueWidth}{Value:w}% 
 974              \par Value: 
 975              \begin{cminipage}[EpydocValueColor]% 
 976                               {\dimexpr \textwidth-2\fboxsep-\EpydocValueWidth} 
 977                \texttt{\cmdEpydoc@variable@value}% 
 978              \end{cminipage}}\par 
 979          \end{cminipage}\par 
 980        \fi% 
 981      \end{minipage}\par}}} 
 982    {} 
 983   
 984  \renewenvironment{EpydocPropertyList}{% 
 985    \setlength{\parskip}{\EpydocListsep}% 
 986    \newcommand{\EpydocProperty}[1]{{% 
 987      \setkeys[Epydoc]{property}{##1}% 
 988      % Decide whether to include a 'details' block 
 989      \newif\ifEpydoc@details% 
 990      \@ifundefined{cmdEpydoc@property@description}{}{\Epydoc@detailstrue}% 
 991      \@ifundefined{cmdEpydoc@property@type}{}{\Epydoc@detailstrue}% 
 992      \@ifundefined{cmdEpydoc@property@fget}{}{\Epydoc@detailstrue}% 
 993      \@ifundefined{cmdEpydoc@property@fset}{}{\Epydoc@detailstrue}% 
 994      \@ifundefined{cmdEpydoc@property@fdel}{}{\Epydoc@detailstrue}% 
 995      % Put a box around the whole thing, so the property's name line  
 996      % and the body don't get split across pages. 
 997      \begin{minipage}{\linewidth}% 
 998        \setlength{\parskip}{-1pt}\raggedleft% 
 999        % Add the variable name in a gray95 box. 
1000        \begin{cminipage}[EpydocNameColor] 
1001                         {\dimexpr \textwidth-2\fboxsep} 
1002          \Large \bfseries \cmdEpydoc@property@name% 
1003        \end{cminipage}\par 
1004        % Add the details in a gray90 box. 
1005        \ifEpydoc@details 
1006          \begin{cminipage}[EpydocDetailsColor] 
1007                           {\dimexpr 0.95\linewidth-2\fboxsep} 
1008            \setlength{\parskip}{\EpydocParskip} 
1009            \@ifundefined{cmdEpydoc@property@description}{}{% 
1010                \par\cmdEpydoc@property@description}% 
1011            \@ifundefined{cmdEpydoc@property@type}{}{% 
1012                \par\textbf{Type:} \cmdEpydoc@property@type}% 
1013            \@ifundefined{cmdEpydoc@property@fget}{}{% 
1014                \par\textbf{Get:} \cmdEpydoc@property@fget}% 
1015            \@ifundefined{cmdEpydoc@property@fset}{}{% 
1016                \par\textbf{Set:} \cmdEpydoc@property@fset}% 
1017            \@ifundefined{cmdEpydoc@property@fdel}{}{% 
1018                \par\textbf{Delete:} \cmdEpydoc@property@fdel}% 
1019          \end{cminipage}\par 
1020        \fi% 
1021      \end{minipage}\par}}} 
1022    {} 
1023   
1024  \renewcommand{\EpydocGroup}[1]{\par 
1025    \begin{cminipage}[EpydocGroupColor] 
1026                     {\dimexpr \linewidth-2\fboxsep} 
1027      {\Large\bf\center #1\\} 
1028    \end{cminipage}\par} 
1029  \renewcommand{\EpydocInheritanceList}[2]{\par 
1030    \begin{cminipage}[EpydocInheritanceListColor] 
1031                     {\dimexpr \textwidth-2\fboxsep} 
1032    \raggedright% 
1033    Inherited from {#1}: #2% 
1034    \end{cminipage}\par} 
1035   
1036  % This is just like the default definitions, except that we use 
1037  % \raggedright, and dedent by \EpydocSectionHeaderDedent 
1038  \renewcommand\section{\@startsection {section}{1}% 
1039                {-\EpydocSectionHeaderDedent}% 
1040                {-3.5ex \@plus -1ex \@minus -.2ex}% 
1041                {2.3ex \@plus.2ex}% 
1042                {\raggedright\normalfont\Large\bfseries}} 
1043  \renewcommand\subsection{\@startsection{subsection}{2}% 
1044                {-\EpydocSectionHeaderDedent}% 
1045                {-3.25ex\@plus -1ex \@minus -.2ex}% 
1046                {1.5ex \@plus .2ex}% 
1047                {\raggedright\normalfont\large\bfseries}} 
1048  \renewcommand\subsubsection{\@startsection{subsubsection}{3}% 
1049                {-\EpydocSectionHeaderDedent}% 
1050                {-3.25ex\@plus -1ex \@minus -.2ex}% 
1051                {1.5ex \@plus .2ex}% 
1052                {\raggedright\normalfont\normalsize\bfseries}} 
1053  """ 
1054   
1055  ###################################################################### 
1056  ###################################################################### 
1057   
1058  BLUE = r""" 
1059  % epydoc-blue.sty 
1060  % 
1061  % A relatively minimal customization of a builtin epydoc style file, 
1062  % showing the basic pieces that need to be present. 
1063  % 
1064  \NeedsTeXFormat{LaTeX2e} 
1065  \ProvidesClass{epydoc-blue}[2008/02/26 v3.0.1 Epydoc Python Documentation] 
1066   
1067  % Load our base package (epydoc-shaded in this case). 
1068  \RequirePackage{xkeyval} 
1069  \DeclareOptionX*{\PassOptionsToPackage{\CurrentOption}{epydoc-shaded}} 
1070  \ProcessOptionsX\relax 
1071  \RequirePackage{epydoc-shaded} 
1072   
1073  % Perform some customizations 
1074  \definecolor{EpydocNameColor}{rgb}{.9,.95,1} 
1075  \definecolor{EpydocDetailsColor}{rgb}{.8,.9,1} 
1076  \definecolor{EpydocValueColor}{rgb}{.7,.85,1} 
1077  \definecolor{EpydocGroupColor}{rgb}{.6,.8,1} 
1078  \definecolor{EpydocInheritanceListColor}{rgb}{.9,.95,1} 
1079  """ 
1080   
1081  ###################################################################### 
1082  ###################################################################### 
1083   
1084  TEMPLATE = r""" 
1085  % epydoc-template.sty 
1086  % 
1087  % This is a starting point for creating new epydoc style files. 
1088  % Add on \renewcommand and \renewenvironment commands to change 
1089  % how different pieces of the documentation are displayed. 
1090  % 
1091  \NeedsTeXFormat{LaTeX2e} 
1092   
1093  % Replace 'XXX' with a new name, and put in the current date: 
1094  \ProvidesClass{epydoc-XXX}[2008/02/26 v3.0.1 Epydoc Python Documentation] 
1095   
1096  % Pass options to the epydoc base package. 
1097  \RequirePackage{xkeyval} 
1098  \DeclareOptionX*{\PassOptionsToPackage{\CurrentOption}{epydoc-base}} 
1099  \ProcessOptionsX\relax 
1100   
1101  \RequirePackage{epydoc-base} 
1102   
1103  % Add \renewcommand and \renewenvironment commands here. 
1104  """ 
1105   
1106  ############################################################ 
1107  ## Stylesheet table 
1108  ############################################################ 
1109   
1110  STYLESHEETS = { 
1111      'base': BASE, 
1112      'boxes': BOXES, 
1113      'shaded': SHADED, 
1114      'default': BOXES, 
1115      'template': TEMPLATE, 
1116      'blue': BLUE, 
1117  } 
1118