]> granicus.if.org Git - python/commitdiff
Extend \verbatiminput so that the typeset version provides the same appearance
authorFred Drake <fdrake@acm.org>
Thu, 28 Mar 2002 22:28:43 +0000 (22:28 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 28 Mar 2002 22:28:43 +0000 (22:28 +0000)
as a verbatim environment.  (The HTML version is already fine.)

Doc/texinputs/python.sty

index 7a1c219a5fc4379f16735d2e3abaf05d190cfa0e..a83f794f076bf08046eadf67616a5339070f801f 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}
     \py@OldEndVerbatim%
   \end{minipage}%
 }
+\renewcommand{\verbatiminput}[1]{%
+  {\setlength{\parindent}{1cm}%
+   % Calculate the text width for the minipage:
+   \setlength{\py@codewidth}{\linewidth}%
+   \addtolength{\py@codewidth}{-\parindent}%
+   %
+   \small%
+   \begin{list}{}{\setlength{\leftmargin}{1cm}}
+     \item%
+     \py@OldVerbatimInput{#1}%
+   \end{list}
+  }%
+}
 
 % This does a similar thing for the {alltt} environment:
 \RequirePackage{alltt}