diff options
author | Fred Drake <fdrake@acm.org> | 2001-04-10 15:53:06 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-04-10 15:53:06 (GMT) |
commit | b5309a956e93b127f42141eb99c4b09ab9e89a44 (patch) | |
tree | e3934fec0857a08d1a22a3aeed6a365062ca2db2 | |
parent | e9901f325e4bfb123479c706288d5c6a09bad406 (diff) | |
download | cpython-b5309a956e93b127f42141eb99c4b09ab9e89a44.zip cpython-b5309a956e93b127f42141eb99c4b09ab9e89a44.tar.gz cpython-b5309a956e93b127f42141eb99c4b09ab9e89a44.tar.bz2 |
Import the alltt package and wrap that environment in a similar way to
the way we handle verbatim, so that it picks up the same indentation and
minipage behavior.
-rw-r--r-- | Doc/texinputs/python.sty | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Doc/texinputs/python.sty b/Doc/texinputs/python.sty index 216f0b0..8a61d87 100644 --- a/Doc/texinputs/python.sty +++ b/Doc/texinputs/python.sty @@ -185,6 +185,27 @@ \end{minipage}% } +% This does a similar thing for the {alltt} environment: +\RequirePackage{alltt} +\let\py@OldAllTT=\alltt +\let\py@OldEndAllTT=\endalltt + +\renewcommand{\alltt}{% + \setlength{\parindent}{1cm}% + % Calculate the text width for the minipage: + \setlength{\py@codewidth}{\linewidth}% + \addtolength{\py@codewidth}{-\parindent}% + % + \par\indent% + \begin{minipage}[t]{\py@codewidth}% + \small% + \py@OldAllTT% +} +\renewcommand{\endalltt}{% + \py@OldEndAllTT% + \end{minipage}% +} + \newcommand{\py@modulebadkey}{{--just-some-junk--}} |