File: pyscript_defs.tex

package info (click to toggle)
pyscript 0.6.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 1,428 kB
  • ctags: 1,175
  • sloc: python: 10,146; makefile: 67
file content (215 lines) | stat: -rw-r--r-- 7,677 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
% Copyright (C) 2002-2006  Alexei Gilchrist and Paul Cochrane
% 
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation; either version 2
% of the License, or (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

% $Id: pyscript_defs.tex,v 1.11 2006/06/06 11:33:11 paultcochrane Exp $

\usepackage{graphicx,color}
\usepackage{amsmath}
\usepackage{makeidx}
\usepackage{alltt}
%\usepackage{verbatim}
%\usepackage{shortvrb}
%\usepackage{verbatimfiles}
\usepackage{rotating}
\usepackage{html}
\usepackage{xspace}
\usepackage{colortbl}

\usepackage{hyperref}

% --------------------------------------------------------------
% Make the sectioning a bit more fancy
% --------------------------------------------------------------

\usepackage{titlesec}
\usepackage{fancyhdr}
\usepackage{fancyvrb}

\titleformat{\chapter}[display]
{\normalfont\LARGE\filcenter\sffamily}
{}{1pc}
{\titlerule[1pt]%
\vspace{1pt}%
\titlerule
\vspace{2ex}\thechapter: }
[\vspace{2ex}\titlerule]

%\titleformat{\section}
%{\titlerule
%\vspace{.8ex}%
%\normalfont\itshape}
%{\thesection.}{.5em}{}

%\titleformat{\section}[frame]
%{\normalfont}
%{\filright
%\footnotesize
%\enspace\thesection\enspace}
%{8pt}{\Large\bfseries\filcenter}

\titleformat{\section}[frame]
{\normalfont}
{}{1ex}{\Large\thesection.\bfseries\filcenter}

\titleformat{\subsection}
{\normalfont\itshape\bfseries}
{\thesubsection.}{.5em}{}

% --------------------------------------------------------------
% Some formating stuff
% --------------------------------------------------------------

% I think it looks nicer if new paragraphs aren't indented
% as we have lots of whitespace anyway. just increase the 
% inter-paragraph space

\setlength{\parindent}{0pt} 
\addtolength{\parskip}{.5\baselineskip}

\newcommand{\pyscript}{\textsl{\texttt{PyScript}}\xspace}

% --------------------------------------------------------------
% sundry shite
% --------------------------------------------------------------

\newcommand {\tbf}[1] {\textbf{#1}}
\newcommand {\tit}[1] {\textit{#1}}
\newcommand {\tmd}[1] {\textmd{#1}}
\newcommand {\trm}[1] {\textrm{#1}}
\newcommand {\tsc}[1] {\textsc{#1}}
\newcommand {\tsf}[1] {\textsf{#1}}
\newcommand {\tsl}[1] {\textsl{#1}}
\newcommand {\ttt}[1] {\texttt{#1}}
\newcommand {\tup}[1] {\textup{#1}}

\newcommand {\mbf}[1] {\mathbf{#1}}
\newcommand {\mmd}[1] {\mathmd{#1}}
\newcommand {\mrm}[1] {\mathrm{#1}}
\newcommand {\msc}[1] {\mathsc{#1}}
\newcommand {\msf}[1] {\mathsf{#1}}
\newcommand {\msl}[1] {\mathsl{#1}}
\newcommand {\mtt}[1] {\mathtt{#1}}
\newcommand {\mup}[1] {\mathup{#1}}

% spell things correctly  (like shite?)
\newenvironment{centre}{\begin{center}}{\end{center}}
\newenvironment{itemise}{\begin{itemize}}{\end{itemize}}

% define commands for describing functions, arguments and stuff
\newenvironment{funcDesc}{\vspace*{2mm}\begin{description}}{\end{description}\vspace*{2mm}}
\newenvironment{funcOpts}{\begin{description}}{\end{description}}
\newenvironment{funcExCode}{The code:\begin{alltt}\MakeShortVerb{\|}}{\DeleteShortVerb{\|}\end{alltt}}
\newenvironment{funcExOut}{Gives the output:\\}{}

\newcommand {\funcName}[1] {\ttt{#1}} % function name
\newcommand {\funcArg}[1] {\tit{#1}} % function argument
\newcommand {\reqArg}[1] {\tit{#1}} % required function argument
\newcommand {\optArg}[1] {\tit{#1}} % optional function argument
\newcommand {\defVal}[1] {\ttt{#1}} % default value of argument
\newcommand {\class} {\tbf{class\xspace}}
\newcommand {\obj}[1] {\ttt{#1}}
\newcommand {\lib}[1] {\ttt{#1}}
% option: first argument is option name, second argument is default
% value if any
\newcommand {\option}[1] {\item[\optArg{#1}: ]}  

\newcommand {\progName}[1] {\ttt{#1}} % external program name
\newcommand {\fileName}[1] {\tbf{\tit{#1}}} % file name

\newcommand {\figwidth} {60mm}
\newcommand {\fig}[1] {Figure~\ref{#1}}
\newcommand {\Sec}[1] {Section~\ref{#1}}

\usepackage{natbib}

\usepackage[nottoc]{tocbibind}  
                                % allows the table of contents, bibliography
                                % and index to be added to the table of
                                % contents if desired, the option used
                                % here specifies that the table of
                                % contents is not to be added.
                                % tocbibind needs to be after natbib
                                % otherwise bits of it get trampled.

% --------------------------------------------------------------
% Code format within \Verb
% --------------------------------------------------------------

\definecolor{pycolor}{rgb}{0,0.4,0}

\DefineVerbatimEnvironment{python}{Verbatim}
{frame=leftline,framerule=.5mm,rulecolor=\color{pycolor},
formatcom=\color{pycolor}\small,fontshape=sl}

%\DefineShortVerb[formatcom=\color{dgreen}\small,fontshape=sl]{\|}

\RecustomVerbatimCommand{\Verb}{Verb}{formatcom=\color{pycolor}\small,fontshape=sl}

\newcommand {\vrb}[1] {\Verb|#1|}
% --------------------------------------------------------------
% example environment
% --------------------------------------------------------------


%\newenvironment{example}{\begin{description}}{\end{description}}
%\newenvironment{example}{\begin{center}\begin{tabular}{|>{\columncolor[gray]{.9}}c|}\hline\\\begin{minipage}{.75\textwidth}}%
%{\end{minipage}\\\hline\end{tabular}\end{center}}

%\newenvironment{example}{\setlength{unitlength}{.8\textwidth}%
%\begin{center}%
%\begin{picture}(0,0)(-1,0)%
%\put(0,0){\line(1,0){.4\textwidth}\line(0,-1){1ex}}%
%\put(0,0){\line(-1,0){.4\textwidth}\line(0,-1){1ex}}%
%\end{picture}\\\begin{minipage}{.75\textwidth}}%
%{\end{minipage}\\x\end{center}}

\newenvironment{example}{%
\begin{center}%
%\makebox{\rule{.4\textwidth}{1pt}Hello\rule{.4\textwidth}{1pt}}\\[5mm]
\makebox[.8\textwidth]{\rule[-.92ex]{1pt}{1ex}\hrulefill\ \raisebox{-.85ex}{Example}\ \hrulefill\rule[-.92ex]{1pt}{1ex}}\\[5mm]
\begin{minipage}{.75\textwidth}}%
{\end{minipage}\\[5mm]
\makebox[.8\textwidth]{\rule{1pt}{1ex}\hrulefill\rule{1pt}{1ex}}\end{center}}

%\newenvironment{example}{%
%\begin{center}%
%\makebox[.8\textwidth]{\rule[-1ex]{1pt}{1ex}\hrulefill\ \raisebox{-1ex}{Example}\ \hrulefill\rule[-1ex]{1pt}{1ex}}\\[5mm]
%\begin{minipage}{.75\textwidth}}%
%{\end{minipage}\\[5mm]
%\makebox[.8\textwidth]{\rule{1pt}{1ex}\hrulefill\rule{1pt}{1ex}}\end{center}}


% --------------------------------------------------------------
% Page layout
% --------------------------------------------------------------
% Page layout ... set for A4

\setlength{\topmargin}{-1.0 cm}
\setlength{\oddsidemargin}{0 cm}
\setlength{\evensidemargin}{0 cm}
\setlength{\textwidth}{18.5 cm}
\addtolength{\textwidth}{-\marginparsep}
\addtolength{\textwidth}{-\marginparwidth}
\setlength{\textheight}{26.5 cm}
\addtolength{\textheight}{-\footskip}

\pagestyle{fancyplain}
\renewcommand{\chaptermark}[1]{\markboth{Chapter \thechapter: #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\lhead[\fancyplain{}{\bfseries\thepage}]{\fancyplain{}{\bfseries\rightmark}}
\rhead[\fancyplain{}{\bfseries\leftmark}]{\fancyplain{}{\bfseries\thepage}}
\rfoot{}
\cfoot{}