Mercurial > cpython-lru_cache-weakref
diff Doc/texinputs/python.sty @ 22637:d778ea9de780 legacy-trunk
Extend \verbatiminput so that the typeset version provides the same appearance
as a verbatim environment. (The HTML version is already fine.)
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Thu, 28 Mar 2002 22:28:43 +0000 |
| parents | 66e85a732ddd |
| children | 3c876ff29a83 |
line wrap: on
line diff
--- a/Doc/texinputs/python.sty Thu Mar 28 22:01:40 2002 +0000 +++ b/Doc/texinputs/python.sty Thu Mar 28 22:28:43 2002 +0000 @@ -175,6 +175,7 @@ \let\py@OldVerbatim=\verbatim \let\py@OldEndVerbatim=\endverbatim \RequirePackage{verbatim} +\let\py@OldVerbatimInput=\verbatiminput % Variable used by begin code command \newlength{\py@codewidth} @@ -194,6 +195,19 @@ \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}
