forked from gc3-uzh-ch/python-course
-
Notifications
You must be signed in to change notification settings - Fork 0
/
s3it.sty
169 lines (151 loc) · 4.99 KB
/
s3it.sty
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
%% s3it.sty
%%
%% LaTeX style file with common commands and settings for the S3IT
%% presentations and documents.
%%
%% generic LaTeX packages/helpers
\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{fixltx2e}
\usepackage{relsize}
%\usepackage[normalem]{ulem}
%% symbol families
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{latexsym}
\usepackage{amssymb}
%% graphics and color
\usepackage{xcolor}
% for the color names, see: http://en.wikibooks.org/wiki/LaTeX/Colors#Predefined_colors
% Apricot Aquamarine Bittersweet Black
% Blue BlueGreen BlueViolet BrickRed
% Brown BurntOrange CadetBlue CarnationPink
% Cerulean CornflowerBlue Cyan Dandelion
% DarkOrchid Emerald ForestGreen Fuchsia
% Goldenrod Gray Green GreenYellow
% JungleGreen Lavender LimeGreen Magenta
% Mahogany Maroon Melon MidnightBlue
% Mulberry NavyBlue OliveGreen Orange
% OrangeRed Orchid Peach Periwinkle
% PineGreen Plum ProcessBlue Purple
% RawSienna Red RedOrange RedViolet
% Rhodamine RoyalBlue RoyalPurple RubineRed
% Salmon SeaGreen Sepia SkyBlue
% SpringGreen Tan TealBlue Thistle
% Turquoise Violet VioletRed White
% WildStrawberry Yellow YellowGreen YellowOrange
\usepackage{graphicx}
\usepackage{tikz}%
\usetikzlibrary{arrows,shapes}%
% For every picture that defines or uses external nodes, you'll have to
% apply the 'remember picture' style. To avoid some typing, we'll apply
% the style to all pictures.
\tikzstyle{every picture}+=[remember picture]%
%% extended table support
\usepackage{colortbl}%
%\newcommand{\cellcolor}[2]{\multicolumn{1}{>{\columncolor{#1}}c}{#2}}
\usepackage{longtable}
\usepackage{mdwtab}
\usepackage{multirow}
\usepackage{float}
\usepackage{textcomp}
%% programming languages support
\usepackage[procnames]{listings}%
\lstloadlanguages{python,sh,tex}%
\lstset{
language=python,%
% --- basic appearance ---
basicstyle=\small\ttfamily,%
%columns=fullflexible,% best results for proportional fonts
commentstyle=\slshape\color{PineGreen},%
keywordstyle=\bfseries,% or \normalfont
morekeywords={as,with,type,yield},%
%identifierstyle=\color{black},%
procnamestyle=\bfseries\color{BrickRed},%
procnamekeys={def},%
stringstyle=\color{MidnightBlue},%
showstringspaces=false,%
emph={self},%
emphstyle=\bfseries\color{gray},%
% --- escaping and special displays ---
escapechar=~,% text between "~" will be rendered as normal TeX
%moredelim=[il][\small\itshape]{\#},% ditto for text beween "#" and end-of-line
texcl,%
mathescape=false,%
%literate={*{=}{{$\gets$ }}1 {==}{{$=$ }}1 {<=}{{$\leq$ }}1 {>=}{{$\geq$ }}1 {!=}{{$\neq$ }}1},%
% --- display ---
%showspaces=false,%
%showstringspaces=false,%
%xleftmargin=2em,%
% --- line numbers ---
%numbers=left,%
%numberstyle=\tiny,%
%stepnumber=1,%
%firstnumber=1%
}%
\lstnewenvironment{python}{\lstset{language=python}}{}%
\lstnewenvironment{sh}{\lstset{language=sh}}{}%
\usepackage{hyperref}
% for a summary of hyperref options,see: http://www.andy-roberts.net/writing/latex/pdfs
\hypersetup{%
colorlinks=true,%
urlcolor=uzh@orange,% defined in `beamerthemeneu-de.sty`
% the following controls how the PDF is opened in the viewer
% there should be no reason to change it
pdfstartview=Fit,%
pdfpagelayout=SinglePage,%
pdfpagemode=UseThumbs
}%
\usepackage{url}
%% Use `\largeskip` or its alias `\+` to get a larger vertical white
%% space between two lines/paragraphs:
\newcommand{\largeskip}{\vspace{1em}}
\newcommand{\+}{\largeskip}
\setlength{\parsep}{1.0em}
%% use `\HL` to highlight a region of text within a code listing
\newcommand{\HL}[1][\relax]{\colorbox{\ifx#1\relax uzh@orange!25 \else #1 \fi}}
%% use `\hl` for highlighting items in listings, etc.
\newcommand{\hl}[1]{{\bfseries\color{uzh@blue} #1}}
%% for questions interspersed in the text
\newenvironment{question}{\+ \em \textbf{Q:}\bgroup}{\egroup}
%% for the `References: ...` at the bottom of the slide
\newenvironment{references}{%
\largeskip \scriptsize%
\emph{Reference:}%
\bgroup
}{%
\egroup%
}
%% for the `See also: ...` at the bottom of the slide
\newenvironment{seealso}{%
\largeskip \small%
\emph{See also:}%
\bgroup
}{%
\egroup%
}
%% for API description lists, etc.
\newenvironment{describe}[1]{%
\+ \raggedright \hl{#1} \\%
\bgroup%
}{%
\egroup%
}
%% exercises (numbered with uppercase letters starting from "A")
\newcounter{exerciseno}%
\setcounter{exerciseno}{1}%
\newenvironment{exercise}{%
\textbf{Exercise \Alph{exerciseno}:}~\bgroup%
}{%
\egroup%
\addtocounter{exerciseno}{1}%
}
\newenvironment{exercise*}[1][\relax]{%
\textbf{Exercise~#1:}~\bgroup%
}{%
\egroup%
}
%% Make completely invisible stuff which comes after \pause when it
%% should not be visible.
\setbeamercovered{transparent=0}