diff options
author | Fred Drake <fdrake@acm.org> | 2002-04-01 18:59:24 +0000 |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2002-04-01 18:59:24 +0000 |
commit | ddfbe89d8bfe3af10bc17c6a8589a59ed9ee3157 (patch) | |
tree | 06324a117f0ca866bbb9360b9891948509449c95 | |
parent | Backport changes to integrate AMK's "What's New in Python X.Y" (diff) | |
download | cpython-ddfbe89d8bfe3af10bc17c6a8589a59ed9ee3157.tar.gz cpython-ddfbe89d8bfe3af10bc17c6a8589a59ed9ee3157.tar.bz2 cpython-ddfbe89d8bfe3af10bc17c6a8589a59ed9ee3157.zip |
Update from trunk:
- make \url force horizontal mode (so it works at the start of a line)
- make \verbatiminput produce results that look like a verbatim
environment
-rw-r--r-- | Doc/texinputs/python.sty | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/Doc/texinputs/python.sty b/Doc/texinputs/python.sty index d37682e5920..a244b06417b 100644 --- a/Doc/texinputs/python.sty +++ b/Doc/texinputs/python.sty @@ -175,24 +175,30 @@ \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: @@ -796,6 +802,7 @@ % 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% |