]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Update from trunk:
authorFred Drake <fdrake@acm.org>
Mon, 1 Apr 2002 18:59:24 +0000 (18:59 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 1 Apr 2002 18:59:24 +0000 (18:59 +0000)
  - make \url force horizontal mode (so it works at the start of a line)
  - make \verbatiminput produce results that look like a verbatim
    environment

Doc/texinputs/python.sty

index d37682e5920de7c5c8b152b2dbf9a010dbdc36de..a244b06417bbdbb9594dc910317e7a50c2ba362f 100644 (file)
 \let\py@OldVerbatim=\verbatim
 \let\py@OldEndVerbatim=\endverbatim
 \RequirePackage{verbatim}
+\let\py@OldVerbatimInput=\verbatiminput
 
 % Variable used by begin code command
 \newlength{\py@codewidth}
 
 \renewcommand{\verbatim}{%
-  \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%
+  \begingroup%
+  \small%
+  \begin{list}{}{\setlength{\leftmargin}{1cm}}
+    \item%
     \py@OldVerbatim%
 }
 \renewcommand{\endverbatim}{%
     \py@OldEndVerbatim%
-  \end{minipage}%
+  \end{list}%
+  \endgroup
+}
+\renewcommand{\verbatiminput}[1]{%
+  {\small%
+   \begin{list}{}{\setlength{\leftmargin}{1cm}}
+     \item%
+     \py@OldVerbatimInput{#1}%
+   \end{list}
+  }%
 }
 
 % This does a similar thing for the {alltt} environment:
 % but only if we actually used hyperref:
 \ifpdf
   \newcommand{\url}[1]{{%
+    \noindent%
     \pdfstartlink attr{/Border [0 0 0]} user{/S /URI /URI (#1)}%
     \py@LinkColor%                              color of the link text
     \small\sf #1%