]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Better solution for code environment.
authorGuido van Rossum <guido@python.org>
Thu, 24 Jan 1991 16:54:29 +0000 (16:54 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 24 Jan 1991 16:54:29 +0000 (16:54 +0000)
Doc/myformat.sty

index 623316e6b326a782c039eb7eec2936ba69bcabaa..a9acd819de47cdc36c48e6e9ea7c6fb53eb4cc0d 100644 (file)
 \newcommand{\Python}{Python}
 \newcommand{\UNIX}{U{\sc nix}}
 
-% Code environment (use together with verbatim!)
+% Calculate the text width for the minipage in the code environment:
+\newlength{\codewidth}
+\setlength{\codewidth}{\textwidth}
+\addtolength{\codewidth}{-\parindent}
+
+% Code environment.  Use together with begin/end verbatim!
 \newenvironment{code}%
-{\nopagebreak\begin{list}{\nopagebreak}{\nopagebreak}\nopagebreak}%
-{\nopagebreak\end{list}\nopagebreak}
+{\vspace{10pt}\par\begin{minipage}{\codewidth}}% begin stuff
+{\end{minipage}\par\vspace{10pt}\noindent}% end stuff