mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Extend \verbatiminput so that the typeset version provides the same appearance
as a verbatim environment. (The HTML version is already fine.)
This commit is contained in:
		
							parent
							
								
									557fe7541d
								
							
						
					
					
						commit
						00f712ee24
					
				
					 1 changed files with 14 additions and 0 deletions
				
			
		|  | @ -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} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Fred Drake
						Fred Drake