From 44000edfce1e6dc1c2e83bb4e1de2f1310d50ce7 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 24 Jan 1991 16:54:29 +0000 Subject: Better solution for code environment. --- Doc/myformat.sty | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Doc/myformat.sty b/Doc/myformat.sty index 623316e..a9acd81 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 -- cgit v0.12