diff Doc/texinputs/python.sty @ 17380:4622af4da9e2 legacy-trunk

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.
author Fred Drake <fdrake@acm.org>
date Tue, 10 Apr 2001 15:53:06 +0000
parents 38e17a089492
children db928a277f8b
line wrap: on
line diff
--- a/Doc/texinputs/python.sty	Tue Apr 10 15:44:33 2001 +0000
+++ b/Doc/texinputs/python.sty	Tue Apr 10 15:53:06 2001 +0000
@@ -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--}}