Sharedwww / talks / pyrex / python.styOpen in CoCalc
Author: William A. Stein
1
% -- I snipped this from the Python documentation distribution -- William Stein
2
% This sets up the {verbatim} environment to be indented and a minipage,
3
% and to have all the other mostly nice properties that we want for
4
% code samples.
5
6
\let\[email protected]=\verbatim
7
\let\[email protected]=\endverbatim
8
\RequirePackage{verbatim}
9
\RequirePackage{pstricks}
10
\newrgbcolor{dred}{0.7 0 0}
11
\newrgbcolor{black}{0 0 0}
12
\newrgbcolor{dgrey}{0.15 0.15 0.15}
13
14
\renewcommand{\verbatim}[1]{%
15
\begin{shadowbox}
16
\setlength{\parindent}{1cm}%
17
\vspace{-2ex}\par\noindent
18
\dred\bf
19
\begin{minipage}[t]{\textwidth}
20
\begin{listing}[#1]\label{listing:#1}
21
\vspace{0.5em}
22
\mbox{}\vspace{-2.5em}\newline{}%
23
\begin{list}{}{\setlength{\leftmargin}{6ex}}%
24
\item%
25
\black\[email protected]%
26
}
27
\renewcommand{\endverbatim}{%
28
\[email protected]%
29
\end{list}%
30
%------------------------------------------------------------------------%
31
\vspace{2ex}\end{listing}
32
\end{minipage}
33
\black
34
\end{shadowbox}
35
}
36
37
38
39