-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmacros.sty
198 lines (157 loc) · 4.87 KB
/
macros.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
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
%%%%%%%%%% Authors and date definition %%%%%%%%%%
\author[]{Arnaud Malapert, Gilles Menez, Marie Pelleau}
\date[]{Master Informatique, Universit\'e C\^ote d'Azur}
%%%%%%%%% Package import %%%%%%%%%%
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{amsmath,amssymb}
\usepackage{amsfonts, wasysym}
\usepackage{stmaryrd}
\usepackage{setspace}
\usepackage{beamerthemeCambridgeUS}
\usecolortheme{dolphin}
\usecolortheme[rgb={0, 0.6, 0.8}]{structure}
\usepackage{calc}
\usepackage{array, multicol}
\usepackage{hyperref}
\usepackage{subfigure}
\usepackage{xspace}
\usepackage{textcomp}
\graphicspath{{figures/}}
%%%%% For nice drawing with tikz :) %%%%%
\usepackage{pgf,tikz, pifont}
\usetikzlibrary{trees}
\usetikzlibrary{positioning}
\definecolor{rose}{rgb}{0.8,0,0.4}
\definecolor{bleu}{rgb}{0,0.6,0.8}
\definecolor{vert}{rgb}{0, 0.8, 0.8}
\definecolor{vertc}{rgb}{0,0.8,0.4}
\definecolor{orange}{rgb}{1,0.4,0.2}
\definecolor{dore}{rgb}{0.7,0.5,0}
\definecolor{jaune}{rgb}{0.9,0.7,0}
\definecolor{mauve}{rgb}{0.6,0,0.8}
\definecolor{bleuc}{rgb}{0.48,0.75,0.86}
\definecolor{bleutc}{rgb}{0.65,0.84,0.9}
\definecolor{bleuttc}{rgb}{0.82,0.95,1}
\hypersetup{
bookmarks=true, % show bookmarks bar?
unicode=false, % non-Latin characters in Acrobat’s bookmarks
pdftoolbar=true, % show Acrobat’s toolbar?
pdfmenubar=true, % show Acrobat’s menu?
pdffitwindow=false, % window fit to page when opened
pdfstartview={FitH}, % fits the width of the page to the window
% pdftitle={My title}, % title
% pdfauthor={Author}, % author
pdfsubject={Programming Challenges}, % subject of the document
% pdfcreator={Creator}, % creator of the document
pdfproducer={LaTeX}, % producer of the document
pdfkeywords={programming, courses, exercises}, % list of keywords
pdfnewwindow=true, % links in new PDF window
colorlinks=true, % false: boxed links; true: colored links
linkcolor=black, % color of internal links (change box color with linkbordercolor)
citecolor=orange, % color of links to bibliography
filecolor=orange, % color of file links
urlcolor=orange % color of external links
}
%%%%%%%%%% Theme style %%%%%%%%%%
\newenvironment{remark}{\begin{alertblock}{Remarque}}{\end{alertblock}}
\setbeamercolor{block title alert}{fg=rose}
\setbeamercolor{alerted text}{fg=rose}
\setbeamercolor{block title example}{fg=vertc}
\setbeamercolor{example text}{fg=vertc}
\renewcommand\emph[1]{\textbf{\textcolor{bleu}{#1}}}
\def\emphr#1{\textbf{\textcolor{rose}{#1}}}
\def\empho#1{\textcolor{orange}{#1}}
\def\emphv#1{\textcolor{vertc}{#1}}
\def\info#1{\textcolor{lightgray}{#1}}
\renewcommand\alert[1]{\textbf{\textcolor{rose}{#1}}}
%%%%%%%%%% Mathématiques %%%%%%%%%%
\def\mb#1{\ensuremath{\mathbb{#1}}}
%%%%%%%%%% Coloration syntaxique %%%%%%%%%%
\newenvironment{code}[1]{\begin{alertblock}{#1}}{\end{alertblock}}
\usepackage{listings}
\lstdefinestyle{codeC}{
mathescape=true,
aboveskip = 0pt,
breaklines = true,
language = C,
basicstyle = \footnotesize,
keywordstyle = \color{bleu},
commentstyle = \itshape\color{vertc},
stringstyle = \color{rose}
}
\lstnewenvironment{C}
{\lstset{style=codeC}}
{}
\def\inlc#1{\lstinline[style=codeC]!#1!}
\lstdefinestyle{codePy}{
mathescape=true,
aboveskip = 0pt,
breaklines = true,
language = Python,
basicstyle = \footnotesize,
keywordstyle = \color{bleu},
commentstyle = \itshape\color{vertc},
stringstyle = \color{rose}
}
\lstnewenvironment{Python}
{\lstset{style=codePy}}
{}
\lstdefinestyle{codeJ}{
mathescape=true,
aboveskip = 0pt,
breaklines = true,
language = Java,
basicstyle = \footnotesize,
keywordstyle = \color{bleu},
commentstyle = \itshape\color{vertc},
stringstyle = \color{rose}
}
\lstnewenvironment{Java}
{\lstset{style=codeJ}}
{}
\lstdefinestyle{codeR}{
mathescape=true,
aboveskip = 0pt,
breaklines = true,
language = R,
basicstyle = \footnotesize,
keywordstyle = \color{bleu},
commentstyle = \itshape\color{vertc},
stringstyle = \color{rose}
}
\lstnewenvironment{R}
{\lstset{style=codeR}}
{}
\lstdefinestyle{codeS}{
aboveskip = 0pt,
breaklines = true,
language = sh,
basicstyle = \footnotesize,
keywordstyle = \color{bleu},
commentstyle = \itshape\color{vertc},
stringstyle = \color{rose}
}
\lstnewenvironment{Shell}
{\lstset{style=codeS}}
{}
\lstdefinelanguage{pseudo}{
morekeywords={return, if, then, foreach, for, while, do, from, to},
sensitive=false,
morecomment=[l]{//},
morecomment=[s]{/*}{*/},
morestring=[b]"
}
\lstdefinestyle{codePseudo}{
mathescape=true,
aboveskip = 0pt,
breaklines = true,
language = pseudo,
basicstyle = \footnotesize,
keywordstyle = \color{bleu},
commentstyle = \itshape\color{vertc},
stringstyle = \color{rose}
}
\lstnewenvironment{PseudoCode}
{\lstset{style=codePseudo}}
{}