mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Better solution for code environment.
This commit is contained in:
parent
0ed6918698
commit
44000edfce
1 changed files with 8 additions and 3 deletions
|
@ -18,7 +18,12 @@
|
|||
\newcommand{\Python}{Python}
|
||||
\newcommand{\UNIX}{U{\sc nix}}
|
||||
|
||||
% Code environment (use together with verbatim!)
|
||||
% Calculate the text width for the minipage in the code environment:
|
||||
\newlength{\codewidth}
|
||||
\setlength{\codewidth}{\textwidth}
|
||||
\addtolength{\codewidth}{-\parindent}
|
||||
|
||||
% Code environment. Use together with begin/end verbatim!
|
||||
\newenvironment{code}%
|
||||
{\nopagebreak\begin{list}{\nopagebreak}{\nopagebreak}\nopagebreak}%
|
||||
{\nopagebreak\end{list}\nopagebreak}
|
||||
{\vspace{10pt}\par\begin{minipage}{\codewidth}}% begin stuff
|
||||
{\end{minipage}\par\vspace{10pt}\noindent}% end stuff
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue