-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcours-style.sty
120 lines (108 loc) · 3.86 KB
/
cours-style.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
% The 4 lines below speed up the compilation, a lot! It stops the compiler from
% compressing the builded PDF file.
\RequirePackage{expl3}
\ExplSyntaxOn
\pdf_uncompress:
\ExplSyntaxOff
% Style
\RequirePackage{xcolor}
\usetheme{Madrid}
\RequirePackage{dirtree}
% Color
\definecolor{flatgreen}{RGB}{210, 247, 219}
\definecolor{flashygreen}{RGB}{30, 215, 95}
\usecolortheme[named=flashygreen]{structure}
% Font
\RequirePackage{emoji}
\RequirePackage{currfile-abspath}
\getpwd
% Concatenate style path to \thepwd
\newcommand{\stylepath}{\thepwd../style/}
% Digicomp font
\RequirePackage{fontspec}
\setmainfont[Path=\stylepath]{Poppins-Regular.ttf}
[Ligatures=TeX,
BoldFont=Poppins-Bold.ttf,
ItalicFont=Poppins-Italic.ttf]
% Custom header and footer
\makeatletter
\setbeamertemplate{footline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{section in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor~~\beamer@ifempty{\insertshortinstitute}{}{(\insertshortinstitute)}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{section in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{section in head/foot}%
\usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
\insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}}%
\vskip0pt%
}
\makeatother
\setbeamercolor{section in head/foot}{fg=black, bg=flatgreen}
% Modify Beamer template
% Items
\setbeamertemplate{itemize items}[square]
\setbeamertemplate{enumerate items}[square]
\setbeamertemplate{itemize subitem}[circle]
\setbeamertemplate{enumerate subitem}[circle]
\setbeamertemplate{itemize subsubitem}[triangle]
\setbeamertemplate{enumerate subsubitem}[triangle]
% TOC
\setbeamertemplate{section in toc}[circle]
\setbeamertemplate{subsection in toc}[square]
% Title
\setbeamertemplate{title page}[default][colsep=-4bp,rounded=true]
\RequirePackage{csquotes}
% Code
\RequirePackage{listings}
\RequirePackage{graphicx}
\RequirePackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=flashygreen,
filecolor=flashygreen,
urlcolor=flashygreen,
citecolor=flashygreen
}
\definecolor{flatgreyish}{RGB}{209, 216, 224}
% Monokai colors as per https://gist.github.com/r-malon/8fc669332215c8028697a0bbfbfbb32a
\definecolor{monokaiComments}{RGB}{121, 121, 121} % #797979
\definecolor{monokaiOrange}{RGB}{232, 125, 62} % #e87d3e
\lstset{
basicstyle=\ttfamily\scriptsize,
backgroundcolor=\color{flatgreyish},
keywordstyle=\color{monokaiOrange}, % Keywords font ('*' = uppercase)
commentstyle=\color{monokaiComments}, % Step between two line-numbers
columns=fullflexible,
breaklines=true,
showstringspaces=false
}
% transition effect
\addtobeamertemplate{background canvas}{\transfade[duration=1]}{}
% Highlight
\RequirePackage[most]{tcolorbox}
\RequirePackage{cleveref}
\crefformat{footnote}{#2\footnotemark[#1]#3}
% Define a new command that return a superscripted ", " (comma and space)
\newcommand{\footnotestep}{\textsuperscript{, }}
\RequirePackage{amsmath}
\RequirePackage{wasysym}
\definecolor{flatorange}{RGB}{255, 165, 2}
\definecolor{flatred}{RGB}{255, 71, 87}
\tcbset{textmarker/.style={%
skin=enhancedmiddle jigsaw,breakable,parbox=false,
boxrule=0mm,leftrule=2mm,rightrule=0mm,boxsep=0mm,arc=0mm,outer arc=0mm,
left=1mm,right=1mm,top=1mm,bottom=1mm,toptitle=1mm,bottomtitle=1mm}}
\newtcolorbox{dangercolorbox}{textmarker,colback=flatorange,colframe=flatred}
% The exercice counter
\newcounter{execounter} % Create a new counter
% Increment the counter and display it
\newcommand\execcounterdispinc{\stepcounter{execounter}\theexecounter}
% TOC is too long it has to be display in 2 or 3 columns
\RequirePackage{multicol}
\setcounter{tocdepth}{2}