Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 00f712e

Browse files
committed
Extend \verbatiminput so that the typeset version provides the same appearance
as a verbatim environment. (The HTML version is already fine.)
1 parent 557fe75 commit 00f712e

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Doc/texinputs/python.sty

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
\let\py@OldVerbatim=\verbatim
176176
\let\py@OldEndVerbatim=\endverbatim
177177
\RequirePackage{verbatim}
178+
\let\py@OldVerbatimInput=\verbatiminput
178179

179180
% Variable used by begin code command
180181
\newlength{\py@codewidth}
@@ -194,6 +195,19 @@
194195
\py@OldEndVerbatim%
195196
\end{minipage}%
196197
}
198+
\renewcommand{\verbatiminput}[1]{%
199+
{\setlength{\parindent}{1cm}%
200+
% Calculate the text width for the minipage:
201+
\setlength{\py@codewidth}{\linewidth}%
202+
\addtolength{\py@codewidth}{-\parindent}%
203+
%
204+
\small%
205+
\begin{list}{}{\setlength{\leftmargin}{1cm}}
206+
\item%
207+
\py@OldVerbatimInput{#1}%
208+
\end{list}
209+
}%
210+
}
197211

198212
% This does a similar thing for the {alltt} environment:
199213
\RequirePackage{alltt}

0 commit comments

Comments
 (0)