diff options
author | Fred Drake <fdrake@acm.org> | 2002-03-28 22:28:43 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2002-03-28 22:28:43 (GMT) |
commit | 00f712ee249d1b1a59cc25ea493443424f9ad11a (patch) | |
tree | c1f062b156d2ddc7634f4dd06d697a84f0b64c17 /Doc/texinputs/python.sty | |
parent | 557fe7541d6b7549c2e2bfb4a041a88e980811d7 (diff) | |
download | cpython-00f712ee249d1b1a59cc25ea493443424f9ad11a.zip cpython-00f712ee249d1b1a59cc25ea493443424f9ad11a.tar.gz cpython-00f712ee249d1b1a59cc25ea493443424f9ad11a.tar.bz2 |
Extend \verbatiminput so that the typeset version provides the same appearance
as a verbatim environment. (The HTML version is already fine.)
Diffstat (limited to 'Doc/texinputs/python.sty')
-rw-r--r-- | Doc/texinputs/python.sty | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Doc/texinputs/python.sty b/Doc/texinputs/python.sty index 7a1c219..a83f794 100644 --- a/Doc/texinputs/python.sty +++ b/Doc/texinputs/python.sty @@ -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} |