-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvpl.sty
204 lines (175 loc) · 5.88 KB
/
vpl.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
199
200
201
202
203
204
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{graphicx,url}
\usepackage[usenames,dvipsnames]{color}
\usepackage[colorlinks=true,linkcolor=Blue,urlcolor=Blue,citecolor=Blue]{hyperref}
\usepackage{microtype}
\usepackage[a4paper,top=3cm,bottom=3cm,inner=2.5cm,outer=4cm]{geometry}
\usepackage{enumitem}
\usepackage{setspace}
\def\UrlFont{\sf\small}
% for boxes
\usepackage[tikz]{bclogo}
\usepackage{framed}
\usepackage{floatrow}
\usepackage{libertine}
\renewcommand*\familydefault{\sfdefault}
\usepackage[T1]{fontenc}
\usepackage{subfigure}
\usepackage[capitalise,noabbrev]{cleveref}
% End of packages
% for language dependent commands
% please put all language dependent information in these files
\DeclareOption{en}{\def \langpack {../../vpl-en}}
\DeclareOption{fr}{\def \langpack {../../vpl-fr}}
\DeclareOption{de}{\def \langpack {../../vpl-de}}
\DeclareOption{it}{\def \langpack {../../vpl-it}}
\ExecuteOptions{en}
\ProcessOptions\relax
\RequirePackage{\langpack}
\renewcommand{\baselinestretch}{1.1}
\setlength{\parskip}{0.4\baselineskip plus 1pt minus 1pt}
\parindent=0pt
% Font for buttons and menus
\newcommand*{\bu}[1]{\textbf{#1}}
% Font for program entities
\newcommand*{\p}[1]{\texttt{\textup{\footnotesize #1}}}
% Inline graphics (large size)
\newcommand*{\blk}[2][-15]{\raisebox{#1pt}%
{\includegraphics[height=40pt,keepaspectratio=true]{#2}}}
% Inline graphics (medium size)
\newcommand*{\blkmed}[2][-10]{\raisebox{#1pt}%
{\includegraphics[height=30pt,keepaspectratio=true]{#2}}}
% Inline graphics (small)
\newcommand*{\blksmpure}[1]{\raisebox{-.2em}%
{\includegraphics[height=1em,keepaspectratio=true]{#1}}}
% Inline graphics (small with large block in margin}
\newcommand*{\blksm}[1]{\raisebox{-.2em}%
{\includegraphics[height=1em,keepaspectratio=true]{#1}}%
\marginpar[\hfill\raisebox{-1.2em}{\includegraphics[width=3em,keepaspectratio=true]{#1}}]%
{\raisebox{-1.2em}{\includegraphics[width=3em,keepaspectratio=true]{#1}}}}
% Inline graphics (small with medium block in margin}
\newcommand*{\blkxsm}[1]{\raisebox{-.2em}%
{\includegraphics[height=1em,keepaspectratio=true]{#1}}%
\marginpar[\hfill\raisebox{-.6em}{\includegraphics[width=2em,keepaspectratio=true]{#1}}]%
{\raisebox{-.6em}{\includegraphics[width=2em,keepaspectratio=true]{#1}}}}
% Centered inline graphics
\newcommand*{\blkc}[1]{\vskip .1em\makebox[\textwidth]{\raisebox{-1em}%
{\includegraphics[height=4em]{#1}}}\vskip .3em}
% Centered image
\newcommand*{\gr}[2]%
{\begin{center}
\includegraphics[width=#2\textwidth,keepaspectratio=true]{#1}
\end{center}}
% Figures
%\DeclareFloatVCode{grayruleabove}%
%{{\color{black!20}\par\rule\hsize{2.2pt}\vskip4pt\par}}
%\DeclareFloatVCode{grayrulebelow}%
%{{\color{black!20}\par\vskip4pt\rule\hsize{2.2pt}}}
%
% commands to switch on and off framing
%\newcommand{\framedfloat}{\floatsetup{framefit=yes,heightadjust=all,framearound=all,rowprecode=grayruleabove,rowpostcode=grayrulebelow}}
\DeclareColorBox{mycolorbox}{\fcolorbox{black!20}{white}}
\newcommand{\framedfloat}{\floatsetup{style=plain,framestyle=colorbox,framefit=yes,heightadjust=all,framearound=all,frameset={\fboxrule3pt\fboxsep4pt},colorframeset=mycolorbox}}
\newcommand{\plainfloat}{\floatsetup{style=plain}}
\framedfloat
% Box
\newenvironment{gbar}[1]{%
\def\FrameCommand {{\color {#1}\vrule width 13 pt }}%
\MakeFramed {\advance\hsize -\width \FrameRestore }}%
{\endMakeFramed}
\newcommand*{\infobox}[4]{%
\vskip .2em%
\begin{bclogo}[couleur = #3, epBord = .5, arrondi = 0.1, logo = #4, ombre = false, barre = none, marge = 8, nobreak=true]{\ #1}%
\begin{gbar}{#3}%
\vspace{.3em}%
#2%
\end{gbar}%
\end{bclogo}%
\vskip .2em%
}
% TODO: remove that
\newcommand{\centeredbox}[1]{%
\begin{center}%
\fbox{%
\begin{minipage}{.8\textwidth}%
#1\end{minipage}}%
\end{center}}
% Change style of chapter and section headings
\newcommand*{\chap}[1]{\chapter[#1]{\LARGE #1}}
\newcommand*{\sect}[1]{\section*{\textit{#1}}}
% Less space before chapter
\makeatletter
\def\@makechapterhead#1{%
\vspace*{10\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \c@secnumdepth >\m@ne
\huge\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 10\p@
}}
\def\@schapter#1{\if@twocolumn
\@topnewpage[\@makeschapterhead{#1}]%
\else
\@makeschapterhead{#1}%
\@afterheading
\fi}
\def\@makeschapterhead#1{%
\vspace*{10\p@}%
{\parindent \z@ \raggedright
\normalfont
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 10\p@
}}
\makeatother
% Listings
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{grey}{rgb}{0.5,0.5,0.5}
\usepackage{listings}
\usepackage{DejaVuSansMono}
\newcommand\digitstyle{\color{blue}}
\makeatletter
\newcommand{\ProcessDigit}[1]
{%
\ifnum\lst@mode=\lst@Pmode\relax%
{\digitstyle #1}%
\else
#1%
\fi
}
\makeatother
\lstdefinelanguage{aseba}
{
morekeywords=[1]{var,if,then,else,do,end,while,ontimer,onevent,emit,call,when,for,in,step,and,or,not},
morecomment=[l]{\#},
}
\lstset{literate=
{0}{{{\ProcessDigit{0}}}}1
{1}{{{\ProcessDigit{1}}}}1
{2}{{{\ProcessDigit{2}}}}1
{3}{{{\ProcessDigit{3}}}}1
{4}{{{\ProcessDigit{4}}}}1
{5}{{{\ProcessDigit{5}}}}1
{6}{{{\ProcessDigit{6}}}}1
{7}{{{\ProcessDigit{7}}}}1
{8}{{{\ProcessDigit{8}}}}1
{9}{{{\ProcessDigit{9}}}}1,
basicstyle=\ttfamily,
language=aseba,
tabsize=4,
keywordstyle={[1]\color{brown}},
aboveskip=0.2em,
belowskip=0.2em,
stringstyle=\color{blue},
commentstyle=\color{dkgreen},
identifierstyle=\color{black},
numbers=left,
numberstyle=\ttfamily\color{grey}
}
%\newfloat{Listing}{tbp}{lst}[chapter]