summaryrefslogtreecommitdiffstats
path: root/Doc/myformat.sty
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-01-24 16:54:29 (GMT)
committerGuido van Rossum <guido@python.org>1991-01-24 16:54:29 (GMT)
commit44000edfce1e6dc1c2e83bb4e1de2f1310d50ce7 (patch)
tree74bd07ec3c9afb992b57ebcadc5778912a2e662f /Doc/myformat.sty
parent0ed691869871d51ab647c004500a41ad1c3dc35c (diff)
downloadcpython-44000edfce1e6dc1c2e83bb4e1de2f1310d50ce7.zip
cpython-44000edfce1e6dc1c2e83bb4e1de2f1310d50ce7.tar.gz
cpython-44000edfce1e6dc1c2e83bb4e1de2f1310d50ce7.tar.bz2
Better solution for code environment.
Diffstat (limited to 'Doc/myformat.sty')
-rw-r--r--Doc/myformat.sty11
1 files 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