initial commit

This commit is contained in:
khannurien
2026-02-10 16:45:35 +01:00
commit 039ad357bb
24 changed files with 2020 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
\ProvidesPackage{packages/sleek-boxes}[2025/01/16 v1.2.1 Sleek Boxes]
%%%%%%%%%%%%
% Settings %
%%%%%%%%%%%%
\RequirePackage{framed}
%%%%%%%%%%
% Styles %
%%%%%%%%%%
\definecolor{bgtitle}{RGB}{85,85,85}
\definecolor{bgbox}{RGB}{232,232,232}
\definecolor{shadecolor}{RGB}{232,232,232}
%%%%%%%%%%%%
% w/ title %
%%%%%%%%%%%%
\newcommand*{\titlebox}[2]{
\begin{center}
\begin{tikzpicture}%
\node[rectangle,draw=bgtitle!100,fill=bgbox!100,inner sep=10pt, inner ysep=20pt] (box)
{
\begin{minipage}{12cm}
#2
\end{minipage}
};
\node[fill=bgtitle!100, text=white, rectangle] at (box.north)
{
\sffamily\textbf{#1}
};
\end{tikzpicture}
\end{center}
}
%%%%%%%%%%%%%
% w/o title %
%%%%%%%%%%%%%
\newcommand*{\simplebox}[1]{%
\begin{center}
\begin{minipage}{12cm}
\begin{shaded}
#1
\end{shaded}
\end{minipage}
\end{center}
}

View File

@@ -0,0 +1,177 @@
\ProvidesPackage{packages/sleek-listings}[2023/09/18 v1.2.1 Sleek Listings]
%%%%%%%%%%%%
% Settings %
%%%%%%%%%%%%
\RequirePackage[scaled=0.95]{inconsolata}
\RequirePackage{listings}
\RequirePackage{xcolor}
%%%%%%%%%%
% Styles %
%%%%%%%%%%
\lstdefinestyle{default}{
breaklines=true,
breakatwhitespace=true,
columns=fixed,
extendedchars=true,
inputencoding=utf8,
keepspaces,
showstringspaces=false,
tabsize=4,
upquote=true,
%%%%%
aboveskip=\baselineskip,
belowskip=\smallskipamount,
captionpos=b,
framerule=0.1em,
%%%%%
basicstyle=\small\ttfamily,
numberstyle=\small\ttfamily
}
\lstset{
style=default,
literate={
{á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1
{Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1
{à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1
{À}{{\`A}}1 {È}{{\'E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1
{ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1
{Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1
{â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1
{Â}{{\^A}}1 {Ê}{{\^E}}1 {Î}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1
{œ}{{\oe}}1 {Œ}{{\OE}}1 {æ}{{\ae}}1 {Æ}{{\AE}}1 {ß}{{\ss}}1
{ç}{{\c c}}1 {Ç}{{\c C}}1 {ø}{{\o}}1 {Ø}{{\O}}1 {å}{{\r a}}1
{Å}{{\r A}}1 {ã}{{\~a}}1 {õ}{{\~o}}1 {Ã}{{\~A}}1 {Õ}{{\~O}}1
{ñ}{{\~n}}1 {Ñ}{{\~N}}1
}
}
\lstdefinestyle{numbered}{
style=default,
numbers=left
}
\lstdefinestyle{framed}{
style=default,
frame=single,
framesep=0em,
rulesep=0em,
xleftmargin=0.75em,
xrightmargin=0.75em,
framexleftmargin=0.75em,
framexrightmargin=0.75em,
framextopmargin=1ex,
framexbottommargin=1ex
}
\lstdefinestyle{framednumbered}{
style=framed,
xleftmargin=2.75em,
framexleftmargin=2.75em,
numbers=left,
numbersep=1em
}
\lstdefinestyle{ruled}{
style=framed,
frame=tb,
xleftmargin=0em,
xrightmargin=0em,
framexleftmargin=0em,
framexrightmargin=0em
}
\lstdefinestyle{rulednumbered}{
style=ruled,
numbers=left
}
%%%%%%%%%%
% Colors %
%%%%%%%%%%
\definecolor{ForestGreen}{HTML}{228B22}
\definecolor{TrueBlue}{HTML}{0000FF}
\definecolor{VeronicaPurple}{HTML}{A020F0}
\definecolor{JustGray}{HTML}{7F7F7F}
\lstdefinestyle{colorful}{
commentstyle=\color{ForestGreen},
keywordstyle=[1]{\color{TrueBlue}},
keywordstyle=[2]{\color{VeronicaPurple}},
stringstyle=\color{JustGray},
emphstyle=\bfseries
}
%%%%%%%%%%%%%
% Languages %
%%%%%%%%%%%%%
\lstdefinelanguage{latex}{
language=[LaTeX]TeX,
morekeywords={RequirePackage},
style=colorful
}
\lstdefinelanguage{c*}{
language=C,
morekeywords={},
style=colorful
}
\lstdefinelanguage{cpp*}{
language=C++,
morekeywords={std},
style=colorful
}
\lstdefinelanguage{matlab*}{
language=matlab,
morekeywords={clearvars, numel},
style=colorful
}
\lstdefinelanguage{python*}{
language=python,
morekeywords=[1]{with, as},
style=colorful
}
\lstdefinelanguage{java*}{
language=java,
morekeywords={},
style=colorful
}
\lstdefinelanguage{scheme}{
alsoletter={!,?,+,-,*,/,<,=,>,\#},
literate=*{`}{{`}}{1},
morecomment=[l]{;},
morecomment=[s]{\#|}{|\#},
morestring=[b]",
morekeywords=[1]{
define, lambda, let, let*, letrec,
eval, read, print, quote, unquote,
list, list*, cons, append, car, cdr, caar, cadr, cdar, cddr, cadar, caddr,
length, reverse, range, member, flatten, filter, count,
eq?, eqv?, equal?, number?, boolean?, zero?, even?, odd?, pair?, list?, null?, symbol?, procedure?, string?,
if, cond, else,
map, apply,
import, export, require,
raise, error,
exit
},
morekeywords=[2]{
+, -, *, /, <, =, >, <=, >=,
and, or, not,
quotient, modulo, expt, sqrt
},
sensitive,
style=colorful
}
\endinput

View File

@@ -0,0 +1,131 @@
\ProvidesPackage{packages/sleek-theorems}[2022/11/18 v1.2.1 Sleek Theorems]
%%%%%%%%%%%%
% Settings %
%%%%%%%%%%%%
\RequirePackage{amsthm}
\RequirePackage{thmtools}
\RequirePackage[framemethod=TikZ]{mdframed}
% Setup
\define@key{thmdef}{mdthm}[{}]{
\thmt@trytwice{\def\thmt@theoremdefiner{\mdtheorem[#1]}}{}
}
% QED symbol
\renewcommand{\qedsymbol}{$\blacksquare$} % filled \qed
%%%%%%%%%%%%%
% Languages %
%%%%%%%%%%%%%
\def\lgtheorem{Theorem}
\def\lgproof{Proof}
\def\lglemma{Lemma}
\def\lgproposition{Proposition}
\def\lgdefinition{Definition}
\def\lghypothesis{Hypothesis}
\def\lgmethod{Method}
\def\lgquestion{Question}
\def\lganswer{Answer}
\def\lgexample{Example}
\def\lgremark{Remark}
\def\lgnote{Note}
\def\lgtip{Tip}
\DeclareOption{french}{
\def\lgtheorem{Théorème}
\def\lgproof{Preuve}
\def\lglemma{Lemme}
\def\lgproposition{Proposition}
\def\lgdefinition{Définition}
\def\lghypothesis{Hypothèse}
\def\lgmethod{Méthode}
\def\lgquestion{Question}
\def\lganswer{Réponse}
\def\lgexample{Exemple}
\def\lgremark{Remarque}
\def\lgnote{Note}
\def\lgtip{Conseil}
}
\DeclareOption{german}{
\def\lgtheorem{Satz}
\def\lgproof{Beweis}
\def\lglemma{Hilfssatz}
\def\lgproposition{Proposition}
\def\lgdefinition{Definition}
\def\lghypothesis{Hypothese}
\def\lgmethod{Methode}
\def\lgquestion{Frage}
\def\lganswer{Antwort}
\def\lgexample{Beispiel}
\def\lgremark{Anmerkung}
\def\lgnote{Notiz}
\def\lgtip{Hinweis}
}
\ProcessOptions\relax
%%%%%%%%%%%%%%%%
% Environments %
%%%%%%%%%%%%%%%%
% Environments
\theoremstyle{plain}
\newtheorem{theorem}{\lgtheorem}
\newtheorem{lemma}[theorem]{\lglemma}
\newtheorem{proposition}[theorem]{\lgproposition}
\theoremstyle{definition}
\newtheorem{definition}{\lgdefinition}
\newtheorem{hypothesis}{\lghypothesis}
\newtheorem{method}{\lgmethod}
\newtheorem{question}{\lgquestion}
\let\proof\relax % overwrite proof environment
\let\endproof\relax
\theoremstyle{remark}
\newtheorem{proof}{\lgproof}[theorem]
\newtheorem{answer}{\lganswer}[question]
\newtheorem{example}{\lgexample}
\newtheorem*{remark}{\lgremark}
\newtheorem*{note}{\lgnote}
\newtheorem*{tip}{\lgtip}
% Framed environments
\mdfdefinestyle{thicc}{
nobreak=true,
skipabove=\topskip,
skipbelow=\topskip,
innerleftmargin=0.5em,
innerrightmargin=0.5em,
innerbottommargin=1ex,
innertopmargin=1ex,
linewidth=0.25em,
roundcorner=0.15em,
linecolor=black!10,
frametitlebackgroundcolor=black!10,
theoremseparator={.}
}
\declaretheorem[mdthm={style=thicc, linecolor=red!20, frametitlebackgroundcolor=red!20}, sibling=theorem, name=\lgtheorem]{fmd-theorem}
\declaretheorem[mdthm={style=thicc, linecolor=red!20, frametitlebackgroundcolor=red!20}, sibling=lemma, name=\lglemma]{fmd-lemma}
\declaretheorem[mdthm={style=thicc, linecolor=blue!20, frametitlebackgroundcolor=blue!20}, sibling=proposition, name=\lgproposition]{fmd-proposition}
\declaretheorem[mdthm={style=thicc, nobreak=false}, sibling=proof, name=\lgproof]{fmd-proof}
\declaretheorem[mdthm={style=thicc, linecolor=black!20!green!20, frametitlebackgroundcolor=black!20!green!20}, sibling=definition, name=\lgdefinition]{fmd-definition}
\declaretheorem[mdthm={style=thicc, linecolor=blue!20, frametitlebackgroundcolor=blue!20}, sibling=hypothesis, name=\lghypothesis]{fmd-hypothesis}
\declaretheorem[mdthm={style=thicc, nobreak=false}, name=\lgmethod]{fmd-method}
\declaretheorem[mdthm={style=thicc, linecolor=orange!20, frametitlebackgroundcolor=orange!20}, sibling=question, name=\lgquestion]{fmd-question}
\declaretheorem[mdthm={style=thicc, nobreak=false}, sibling=answer, name=\lganswer]{fmd-answer}
\declaretheorem[mdthm={style=thicc, nobreak=false}, sibling=example, name=\lgexample]{fmd-example}
\endinput

View File

@@ -0,0 +1,157 @@
\ProvidesPackage{packages/sleek-title}[2022/09/13 v1.2.0 Sleek Title]
%%%%%%%%%%%%
% Settings %
%%%%%%%%%%%%
\RequirePackage{geometry}
\RequirePackage{graphicx}
\RequirePackage[framemethod=TikZ]{mdframed}
\RequirePackage[
% nomessages
]{fp}
%%%%%%%%%%%
% Heights %
%%%%%%%%%%%
\newlength\topheight
\newlength\logoheight
\newlength\titleskipabove
\newlength\titleskipbelow
\newcommand*{\calculateheights}{
\countlines{\bfseries\huge\@title}
\FPeval{\topratio}{0.3 - 0.01 * (\numlines - 1)}
\FPeval{\skipratio}{\topratio - 0.15}
\setlength{\logoheight}{0.15\textheight}
\setlength{\topheight}{\topratio\textheight}
\setlength{\titleskipabove}{\skipratio\textheight}
\setlength{\titleskipbelow}{3ex}
}
\DeclareOption{classic}{
\renewcommand*{\calculateheights}{
\setlength{\logoheight}{0.125\textheight}
\setlength{\topheight}{0.2\textheight}
\setlength{\titleskipabove}{1.5cm}
\setlength{\titleskipbelow}{1.5cm}
}
}
\ProcessOptions\relax
%%%%%%%%%%%%
% Commands %
%%%%%%%%%%%%
% Auxiliary commands
\newcommand*{\clearpar}{\unskip\par}
\newcommand*{\countlines}[1]{ % saves the number of lines of #1 in \numlines
\setbox0\vbox{
\noindent{#1}\par
\count@\z@
\loop
\unskip\unpenalty\unskip\unpenalty\unskip
\setbox0\lastbox
\ifvoid0
\xdef\numlines{\the\count@}
\else
\advance\count@\@ne
\repeat
}
}
% Custom fields
\newif\ifLogo
\newif\ifInstitute
\newif\ifFaculty
\newif\ifDepartment
\newif\ifSubtitle
\newif\ifSupervisor
\newif\ifContext
\newcommand*{\logo}[1]{\gdef\@logo{#1}\Logotrue}
\newcommand*{\institute}[1]{\gdef\@institute{#1}\Institutetrue}
\newcommand*{\faculty}[1]{\gdef\@faculty{#1}\Facultytrue}
\newcommand*{\department}[1]{\gdef\@department{#1}\Departmenttrue}
\newcommand*{\subtitle}[1]{\gdef\@subtitle{#1}\Subtitletrue}
\newcommand*{\supervisor}[1]{\gdef\@supervisor{#1}\Supervisortrue}
\newcommand*{\context}[1]{\gdef\@context{#1}\Contexttrue}
% Title page
\renewcommand*{\maketitle}{
\calculateheights
\newgeometry{margin=2.5cm}
\begin{titlepage}
\setlength{\parindent}{0pt}
\begin{minipage}[t][\topheight]{\textwidth}
\begin{center}
\ifLogo
% \includegraphics[height=\logoheight]{\@logo}
\includegraphics[width=\textwidth]{\@logo}
\fi
\vfill
{
\scshape
\ifInstitute
{\LARGE\@institute\unskip\\}
\fi
\ifFaculty
{\Large\@faculty\unskip\\[1ex]}
\fi
\ifDepartment
{\large\@department}
\fi
\clearpar
}
\end{center}
\end{minipage}
\begin{minipage}{\textwidth}
\vspace{\titleskipabove}
\begin{mdframed}[
linewidth=2pt,
innertopmargin=3ex,
innerbottommargin=3ex,
leftline=false,
rightline=false
]
\begin{center}
{\bfseries\huge\@title\clearpar}
\end{center}
\end{mdframed}
\vspace{-0.25cm}
\vspace{\titleskipbelow}
\end{minipage}
\begin{center}
\ifSubtitle
{\Large\@subtitle\clearpar}
\fi
\vfill
\ifSupervisor
\begin{minipage}[t]{0.49\textwidth}
{\large\@author\clearpar}
\end{minipage}
\begin{minipage}[t]{0.49\textwidth}
\begin{flushright}
{\large\@supervisor\clearpar}
\end{flushright}
\end{minipage}
\else
{\large\@author}
\fi
\vfill
\ifContext
{\large\@context\clearpar}
\fi
{\large\@date\clearpar}
\end{center}
\end{titlepage}
\restoregeometry
}
\endinput

261
Rapport/packages/sleek.sty Normal file
View File

@@ -0,0 +1,261 @@
\ProvidesPackage{packages/sleek}[2023/09/18 v1.2.3 Sleek]
%%%%%%%%%%%%
% Settings %
%%%%%%%%%%%%
% Encoding
\RequirePackage[utf8]{inputenc}
% Font
% \RequirePackage{lmodern}
\RequirePackage{mlmodern}
% \RequirePackage{libertinus}
\RequirePackage[T1]{fontenc}
\RequirePackage{microtype}
% Layout
\RequirePackage{geometry}
\RequirePackage{fancyhdr}
\RequirePackage[bottom]{footmisc}
\RequirePackage{lscape}
\geometry{margin=2.5cm}
\pagestyle{fancy}
\fancyhead[L]{}
\fancyhead[R]{}
\fancyfoot[C]{\thepage}
\renewcommand*{\headrulewidth}{0pt}
% Code blocks
\RequirePackage[newfloat]{minted}
% https://tex.stackexchange.com/a/254177
% Non-floating listing environment (w/ page breaks)
\newenvironment{longlisting}{\captionsetup{type=listing}}{}
% Floating listing environment (w/o page breaks)
\SetupFloatingEnvironment{listing}{}
% Text
\RequirePackage{csquotes}
\RequirePackage[inline]{enumitem}
\RequirePackage{eurosym}
\RequirePackage[parfill]{parskip}
\RequirePackage[dvipsnames]{xcolor}
% Links
\RequirePackage[
pdfusetitle,
colorlinks=true,
citecolor=purple,
filecolor=black,
linkcolor=blue,
urlcolor=blue,
linktoc=page,
]{hyperref}
\RequirePackage{bookmark}
\RequirePackage{qrcode}
% Mathematics
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{bm}
\RequirePackage{esint}
\RequirePackage{mathtools}
% Units
\RequirePackage{siunitx}
\sisetup{separate-uncertainty}
\sisetup{separate-uncertainty-units=single}
% Markers
\RequirePackage{circledsteps}
\pgfkeys{/csteps/inner color=white}
\pgfkeys{/csteps/fill color=black}
% Figures
\RequirePackage{float}
\RequirePackage[skip=1.5ex]{caption}
\RequirePackage{subcaption}
\captionsetup{labelsep=period} % 'Figure 1.2.' instead of 'Figure 1.2:'
% Tables
\RequirePackage{array}
\RequirePackage{booktabs}
\RequirePackage{tabularx}
\RequirePackage{multirow}
\renewcommand{\arraystretch}{1.1}
\newcolumntype{Z}{>{\centering\arraybackslash}X} % Tabular text-wrapping column
\renewcommand\tabularxcolumn[1]{m{#1}} % Vertical centering of text in X columns
% Algorithms
\RequirePackage[ruled]{algorithm}
\RequirePackage[noend]{algpseudocode}
\makeatletter
\renewcommand\fs@ruled{% https://ctan.org/pkg/float
\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@ruled%
\def\@fs@pre{\hrule height \heavyrulewidth depth 0pt \kern 4pt}%
\def\@fs@mid{\kern 4pt \hrule height \heavyrulewidth depth 0pt \kern 4pt}%
\def\@fs@post{\kern 4pt \hrule height \heavyrulewidth depth 0pt \relax}%
\let\@fs@iftopcapt\iftrue%
}
\makeatother
\algrenewcommand{\algorithmiccomment}[1]{\hfill #1}
\algrenewcommand{\alglinenumber}[1]{\footnotesize{#1}}
\algnewcommand\Input{\item[\textbf{Input:}]}
\algnewcommand\Output{\item[\textbf{Output:}]}
\algnewcommand\Break{\textbf{break}}
\algnewcommand\Continue{\textbf{continue}}
% Glossaries
\RequirePackage[
automake,
nonumberlist,
toc=false
]{glossaries-extra}
\setglossarysection{section}
% Bibliography
\RequirePackage[
hyperref,
backend=biber,
style=numeric,
% sorting=none,
% maxcitenames=1,
% maxbibnames=3,
% backref=true
]{biblatex}
\setlength\bibitemsep{1ex}
\DeclareFieldFormat*{title}{\enquote{#1}}
\DeclareFieldFormat*{citetitle}{\enquote{#1}}
\DefineBibliographyStrings{english}{
backrefpage = {page},
backrefpages = {pages}
}
\DefineBibliographyStrings{french}{
backrefpage = {page},
backrefpages = {pages}
}
\DefineBibliographyStrings{german}{
backrefpage = {Seite},
backrefpages = {Seiten}
}
% Others
\RequirePackage{comment}
%%%%%%%%%%%
% Options %
%%%%%%%%%%%
\DeclareOption{header}{
\geometry{top=3.5cm, bottom=2.5cm, right=2.5cm, left=2.5cm}
\fancyhead[R]{\leftmark}
}
\DeclareOption{french}{
%% Babel
\frenchbsetup{StandardLists=true}
\frenchbsetup{SmallCapsFigTabCaptions=false}
%% Macros
\def\cad{c.-à-d.\@}
\def\Cad{C.-à-d.\@}
}
\ProcessOptions\relax
%%%%%%%%%%%%
% Commands %
%%%%%%%%%%%%
% Abbreviations
\def\cf{\emph{cf.}\@} % confer
\def\eg{\emph{e.g.}\@} % exempli gratia
\def\ie{\emph{i.e.}\@} % id est
% Table of contents
\newcommand*{\romantableofcontents}{ % table of contents with roman (i, ii, ...) numbering of the pages
\newpage
\pagenumbering{roman}
\tableofcontents
\newpage
\pagenumbering{arabic}
}
% Mathematics
\DeclarePairedDelimiter\rbk{(}{)} % round brackets (parentheses)
\DeclarePairedDelimiter\cbk{\{}{\}} % curly brackets {braces}
\DeclarePairedDelimiter\sbk{[}{]} % square brackets [brackets]
\DeclarePairedDelimiter\abs{\lvert}{\rvert} % absolute value |x|
\DeclarePairedDelimiter\norm{\lVert}{\rVert} % norm ||x||
\DeclarePairedDelimiter\ceil{\lceil}{\rceil} % ceil ⌈x⌉
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor} % floor ⌊x⌋
\newcommand*{\fact}[1]{#1!} % factorial x!
\renewcommand*{\d}[1]{\operatorname{d}\!{#1}} % upright 'd' for differential
\DeclareMathOperator{\tr}{tr} % trace
\DeclareMathOperator{\diag}{diag} % diagonal
% Figures
\newcommand*{\noskipcaption}[1]{\caption{#1}\vspace{-\intextsep}} % caption without additional vertical space
% Footnotes
\makeatletter
\def\blindfootnote{\gdef\@thefnmark{}\@footnotetext} % footnote without number
\makeatother
\endinput
% In-PDF comments
\newboolean{showcomments}
\setboolean{showcomments}{true}
\ifthenelse{\boolean{showcomments}}
{ \newcommand{\mynote}[3]{
\fbox{\bfseries\sffamily\scriptsize#1}
{\small$\blacktriangleright$\textsf{\emph{\color{#3}{#2}}}$\blacktriangleleft$}}}
{ \newcommand{\mynote}[3]{}}
\newcommand{\shrink}[1]{}
\newcommand{\jb}[1]{\mynote{Jalil}{#1}{red}}
\newcommand{\vl}[1]{\mynote{Vincent}{#1}{blue}}