From: Guido van Rossum Date: Thu, 24 Jan 1991 16:54:29 +0000 (+0000) Subject: Better solution for code environment. X-Git-Tag: v0.9.8~1053 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=44000edfce1e6dc1c2e83bb4e1de2f1310d50ce7;p=thirdparty%2FPython%2Fcpython.git Better solution for code environment. --- diff --git a/Doc/myformat.sty b/Doc/myformat.sty index 623316e6b326..a9acd819de47 100644 --- a/Doc/myformat.sty +++ b/Doc/myformat.sty @@ -18,7 +18,12 @@ \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