Commit 42924041 authored by Anne GARCIA-FERNANDEZ's avatar Anne GARCIA-FERNANDEZ Committed by node
Browse files

Update on Overleaf.

parents
MIT License
Copyright (c) 2020 François Rozet
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# Sleek Template
Sleek Template is a minimal collection of [LaTeX](https://www.latex-project.org/) packages and settings that ease the writing of beautiful documents. While originally meant for theses, it is perfectly suitable for project reports, articles, syntheses, etc. – with a few adjustments, like margins.
It is composed of four separate packages – `sleek`, `sleek-title`, `sleek-theorems` and `sleek-listings` – each of which can be used individually.
For more information about the packages, settings, environments, commands, etc., please refer to the documentation file [`main.pdf`](main.pdf), which also acts as showcase document.
## Overleaf :leaves:
Sleek Template is [Overleaf](https://www.overleaf.com/) ready!
1. Download the repository [archive](https://github.com/francois-rozet/sleek-template/archive/overleaf.zip)
2. On your Overleaf project page, click **New Project** and choose **Upload Project**
3. Drag or select the downloaded archive
4. Rename the project
5. Enjoy :ok_hand:
## Author
* **François Rozet** - [francois-rozet](https://github.com/francois-rozet)
File added
This diff is collapsed.
\ProvidesPackage{sleek-listings}[2020/10/28 v1.0 Sleek Listings]
%%%%%%%%%%%%%%%%
% Requirements %
%%%%%%%%%%%%%%%%
\RequirePackage{inconsolata}
\RequirePackage{listingsutf8}
\RequirePackage{xcolor}
%%%%%%%%%%%%
% Settings %
%%%%%%%%%%%%
% Colors
\def\ForestGreen{\color[HTML]{228B22}}
\def\TrueBlue{\color[HTML]{0000FF}}
\def\VeronicaPurple{\color[HTML]{A020F0}}
\def\FreeSpeechRed{\color[HTML]{DD0000}}
\def\SafetyOrange{\color[HTML]{FF7700}}
\def\DarkMagenta{\color[HTML]{900090}}
\def\IslamicGreen{\color[HTML]{00AA00}}
%%%%%%%%%%%%
% Commands %
%%%%%%%%%%%%
\newcommand{\NumberStyle}[1]{
\lstdefinestyle{#1Number}{
style=#1,
%%%%%
numbers=left
}
}
\newcommand{\FrameStyle}[1]{
\lstdefinestyle{#1Frame}{
style=#1,
%%%%%
frame=single,
framesep=0em,
rulesep=0em,
xleftmargin=0.75em,
xrightmargin=0.75em,
framexleftmargin=0.75em,
framexrightmargin=0.75em,
framextopmargin=0.5em,
framexbottommargin=0.5em
}
}
\newcommand{\FrameTBStyle}[1]{
\FrameStyle{#1}
\lstdefinestyle{#1FrameTB}{
style=#1Frame,
%%%%%
frame=tb,
xleftmargin=0em,
xrightmargin=0em,
framexleftmargin=0em,
framexrightmargin=0em
}
}
\newcommand{\FrameTBNumberStyle}[1]{
\FrameTBStyle{#1}
\NumberStyle{#1FrameTB}
}
\newcommand{\FrameNumberStyle}[1]{
\FrameStyle{#1}
\lstdefinestyle{#1FrameNumber}{
style=#1Frame,
%%%%%
xleftmargin=2.75em,
framexleftmargin=2.75em,
%%%%%
numbers=left,
numbersep=1em
}
}
%%%%%%%%%%
% Styles %
%%%%%%%%%%
\lstdefinestyle{default}{
breaklines=true,
breakatwhitespace=true,
columns=fixed,
extendedchars=true,
upquote=true,
tabsize=4,
%%%%%
framerule=0.1em,
captionpos=b,
aboveskip=\baselineskip,
belowskip=\smallskipamount,
%%%%%
basicstyle=\footnotesize\ttfamily,
numberstyle=\footnotesize\ttfamily,
showstringspaces=false,
inputencoding=utf8,
literate=
{é}{{\'e}}{1}%
{è}{{\`e}}{1}%
{à}{{\`a}}{1}%
{â}{{\^a}}{1}%%%
{ç}{{\c{c}}}{1}%
{œ}{{\oe}}{1}%
{ù}{{\`u}}{1}%
{É}{{\'E}}{1}%
{È}{{\`E}}{1}%
{À}{{\`A}}{1}%
{Ç}{{\c{C}}}{1}%
{Œ}{{\OE}}{1}%
{Ê}{{\^E}}{1}%
{ê}{{\^e}}{1}%
{î}{{\^i}}{1}%
{ï}{{\"i}}{1}%%%
{ô}{{\^o}}{1}%
{û}{{\^u}}{1}%
}
\lstdefinelanguage{HTML5}{
language=html,
sensitive=true,
alsoletter={<>=-},
otherkeywords={
% HTML tags
<html>, <head>, <title>, </title>, <meta, />, </head>, <body>,
<canvas, \/canvas>, <script>, </script>, </body>, </html>, <!, html>, <style>, </style>, ><
},
ndkeywords={
% General
=,
% HTML attributes
charset=, id=, width=, height=,
% CSS properties
border:, transform:, -moz-transform:, transition-duration:, transition-property:, transition-timing-function:
},
morecomment=[s]{<!--}{-->},
tag=[s]
}
\lstset{style=default}
\NumberStyle{default}
\FrameNumberStyle{default}
\FrameTBNumberStyle{default}
\lstdefinestyle{monokai}{
style=Framedefault,
%%%%%
backgroundcolor=\color[HTML]{272822},
framerule=0em,
%%%%%
basicstyle=\footnotesize\ttfamily\color[HTML]{F8F8F2},
numberstyle=\footnotesize\ttfamily\color[HTML]{272822},
commentstyle=\color[HTML]{75715E},
keywordstyle=[1]{\color[HTML]{F92672}},
keywordstyle=[2]{\color[HTML]{A6E22E}},
keywordstyle=[3]{\color[HTML]{AE81FF}},
stringstyle=\color[HTML]{E6DB74},
%%%%%
% otherkeywords={!,.,+,-,*,/,=,<,>,^,|,\&,OR,AND}
}
\lstdefinestyle{monokaiNumber}{
style=monokai,
%%%%%
xleftmargin=2.75em,
framexleftmargin=2.75em,
%%%%%
numbers=left,
numberstyle=\footnotesize\ttfamily\color[HTML]{f8f8f2},
numbersep=1em
}
\lstdefinestyle{c}{
language=C,
style=default,
%%%%%
commentstyle=\ForestGreen,
keywordstyle=\TrueBlue,
stringstyle=\VeronicaPurple,
emphstyle=\TrueBlue,
%%%%%
emph={}
}
\lstdefinestyle{cpp}{
language=C++,
style=default,
%%%%%
commentstyle=\ForestGreen,
keywordstyle=\TrueBlue,
stringstyle=\VeronicaPurple,
emphstyle=\TrueBlue,
%%%%%
emph={std}
}
\lstdefinestyle{matlab}{
language=matlab,
style=default,
%%%%%
basicstyle=\footnotesize\fontfamily{pcr}\selectfont,
numberstyle=\footnotesize\fontfamily{pcr}\selectfont,
commentstyle=\ForestGreen,
keywordstyle=\TrueBlue,
stringstyle=\VeronicaPurple,
emphstyle=\TrueBlue,
%%%%%
emph={clearvars}
}
\lstdefinestyle{python}{
language=python,
style=default,
%%%%%
commentstyle=\FreeSpeechRed,
keywordstyle=[1]{\SafetyOrange},
keywordstyle=[2]{\DarkMagenta},
stringstyle=\IslamicGreen,
emphstyle=\SafetyOrange,
%%%%%
emph={as}
}
\lstdefinestyle{java}{
language=java,
style=default,
%%%%%
commentstyle=\ForestGreen,
keywordstyle=\TrueBlue,
stringstyle=\VeronicaPurple,
emphstyle=\TrueBlue,
%%%%%
emph={}
}
\endinput
\ProvidesPackage{sleek-theorems}[2020/10/28 v1.0 Sleek Theorems]
%%%%%%%%%%%%%%%%
% Requirements %
%%%%%%%%%%%%%%%%
\RequirePackage{amsthm}
\RequirePackage{thmtools}
\RequirePackage[framemethod=TikZ]{mdframed}
%%%%%%%%%%%%
% Settings %
%%%%%%%%%%%%
% Setup
\define@key{thmdef}{mdthm}[{}]{
\thmt@trytwice{\def\thmt@theoremdefiner{\mdtheorem[#1]}}{}
}
\begingroup
\@for\theoremstyle:=plain,definition,remark\do{
\expandafter\g@addto@macro\csname th@\theoremstyle\endcsname{
\addtolength\thm@preskip\parskip
}
}
\endgroup
% QED symbol
\renewcommand{\qedsymbol}{$\blacksquare$}
\newcommand\qedadd{\pushQED{\qed}\popQED}
% Languages
\def\lgthm{Theorem}
\def\lgprf{Proof}
\def\lglem{Lemma}
\def\lgprop{Proposition}
\def\lgdefn{Definition}
\def\lghyp{Hypothesis}
\def\lgmeth{Method}
\def\lgquest{Question}
\def\lgansw{Answer}
\def\lgexpl{Example}
\def\lgrmk{Remark}
\def\lgnote{Note}
\def\lgtip{Tip}
\DeclareOption{french}{
\def\lgthm{Théorème}
\def\lgprf{Preuve}
\def\lglem{Lemme}
\def\lgprop{Proposition}
\def\lgdefn{Définition}
\def\lghyp{Hypothèse}
\def\lgmeth{Méthode}
\def\lgquest{Question}
\def\lgansw{Réponse}
\def\lgexpl{Exemple}
\def\lgrmk{Remarque}
\def\lgnote{Note}
\def\lgtip{Conseil}
}
%%%%%%%%%%%%%%%%
% Environments %
%%%%%%%%%%%%%%%%
% Environments
\theoremstyle{plain}
\newtheorem{thm}{\lgthm}
\newtheorem{lem}[thm]{\lglem}
\newtheorem{prop}[thm]{\lgprop}
\theoremstyle{definition}
\newtheorem{defn}{\lgdefn}
\newtheorem{hyp}{\lghyp}
\newtheorem{meth}{\lgmeth}
\newtheorem{quest}{\lgquest}
\theoremstyle{remark}
\newtheorem{answ}{\lgansw}[quest]
\newtheorem{expl}{\lgexpl}
\newtheorem*{rmk}{\lgrmk}
\newtheorem*{note}{\lgnote}
\newtheorem*{tip}{\lgtip}
% Framed environments
\mdfdefinestyle{thicc}{
nobreak=true,
skipabove=\topskip,
skipbelow=\topskip,
innerleftmargin=0.5em,
innerrightmargin=0.5em,
innerbottommargin=0.5em,
innertopmargin=0.5em,
linewidth=0.25em,
roundcorner=0.15em,
linecolor=black!10,
frametitlebackgroundcolor=black!10,
theoremseparator={.}
}
\declaretheorem[mdthm={style=thicc, linecolor=red!20, frametitlebackgroundcolor=red!20}, sibling=thm, name=\lgthm]{framedthm}
\declaretheorem[mdthm={style=thicc, linecolor=red!20, frametitlebackgroundcolor=red!20}, sibling=thm, name=\lglem]{framedlem}
\declaretheorem[mdthm={style=thicc, linecolor=blue!20, frametitlebackgroundcolor=blue!20}, sibling=thm, name=\lgprop]{framedprop}
\declaretheorem[mdthm={style=thicc, nobreak=false}, parent=thm, name=\lgprf]{framedprf}
\declaretheorem[mdthm={style=thicc, linecolor=black!20!green!20, frametitlebackgroundcolor=black!20!green!20}, sibling=defn, name=\lgdefn]{frameddefn}
\declaretheorem[mdthm={style=thicc, linecolor=blue!20, frametitlebackgroundcolor=blue!20}, sibling=hyp, name=\lghyp]{framedhyp}
\declaretheorem[mdthm={style=thicc, nobreak=false}, name=\lgmeth]{framedmeth}
\declaretheorem[mdthm={style=thicc, linecolor=orange!20, frametitlebackgroundcolor=orange!20}, sibling=quest, name=\lgquest]{framedquest}
\declaretheorem[mdthm={style=thicc, nobreak=false}, sibling=answ, name=\lgansw]{framedansw}
\declaretheorem[mdthm={style=thicc, nobreak=false}, sibling=expl, name=\lgexpl]{framedexpl}
\ProcessOptions\relax
\endinput
\ProvidesPackage{sleek-title}[2020/10/28 v1.0 Sleek Titlepage]
%%%%%%%%%%%%%%%%
% Requirements %
%%%%%%%%%%%%%%%%
\RequirePackage{geometry}
\RequirePackage{graphicx}
\RequirePackage[framemethod=TikZ]{mdframed}
\RequirePackage[nomessages]{fp}
%%%%%%%%%%%%
% Commands %
%%%%%%%%%%%%
% Auxiliary commands
\newcommand*{\clearpar}{\unskip\par} % or \unskip\strut\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
}
}
\newcommand*{\adjustheight}{ % saves the height of the top and bottom mini-pages in \miniheight
\countlines{\bfseries\huge\@title}
\FPeval{\miniheight}{0.435 - 0.02 * (\numlines - 1)}
}
% Custom fields
\newif\ifLogo
\newif\ifInstitute
\newif\ifFaculty
\newif\ifDepartment
\newif\ifSubtitle
\newif\ifSupervisor
\newif\ifContext
\newcommand*{\logo}[1]{\gdef\@logo{#1}\global\Logotrue}
\newcommand*{\institute}[1]{\gdef\@institute{#1}\global\Institutetrue}
\newcommand*{\faculty}[1]{\gdef\@faculty{#1}\global\Facultytrue}
\newcommand*{\department}[1]{\gdef\@department{#1}\global\Departmenttrue}
\newcommand*{\subtitle}[1]{\gdef\@subtitle{#1}\global\Subtitletrue}
\newcommand*{\supervisor}[1]{\gdef\@supervisor{#1}\global\Supervisortrue}
\newcommand*{\context}[1]{\gdef\@context{#1}\global\Contexttrue}
%%%%%%%%%%%%%%
% Title-page %
%%%%%%%%%%%%%%
\renewcommand*{\maketitle}{%
\adjustheight
\newgeometry{margin = 2.5cm}
\begin{titlepage}
\begin{minipage}[t][\miniheight\textheight]{\textwidth}
\begin{center}
\ifLogo
\includegraphics[height=0.15\textheight]{\@logo}
\fi
\vfill
{\scshape\ifInstitute\LARGE\@institute\fi\ifFaculty\ifInstitute\\[0.125em]\fi\Large\@faculty\fi\ifDepartment\\[0.25em]\large\@department\fi\clearpar}
\vfill
\end{center}
\end{minipage}
\vfill
\begin{minipage}{\textwidth}
\begin{mdframed}[linewidth=2pt, innertopmargin=1.5em, innerbottommargin=1.5em, leftline=false, rightline=false]
\begin{center}
{\bfseries\huge\@title\clearpar}
\end{center}
\end{mdframed}
\end{minipage}
\vfill
\begin{minipage}[b][\miniheight\textheight][t]{\textwidth}
\begin{center}
\ifSubtitle
\begin{center}
{\Large\@subtitle\clearpar}
\end{center}
\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\clearpar}
\fi
\vfill
\ifContext
{\large\@context\par}
\fi
{\large\@date\par}
\end{center}
\end{minipage}
\end{titlepage}
\restoregeometry
}
\endinput
\ProvidesPackage{sleek}[2020/10/29 v1.01 Sleek Package]
%%%%%%%%%%%%%%%%
% Requirements %
%%%%%%%%%%%%%%%%
% Encoding
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
\RequirePackage{eurosym}
% Style
\RequirePackage{geometry}
\RequirePackage{fancyhdr}
\RequirePackage[bottom]{footmisc}
\edef\restoreparindent{\parindent=\the\parindent\relax}
\RequirePackage[parfill]{parskip}
\RequirePackage{enumitem}
\RequirePackage{csquotes}
\RequirePackage{xcolor}
% Links
\RequirePackage[
pdfusetitle,
colorlinks=true,
linktoc=page,
allcolors=blue
]{hyperref}
% Mathematics
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\RequirePackage{bm}
\RequirePackage{esint}
% Units
\RequirePackage{siunitx}
% Figures
\RequirePackage{float}
\RequirePackage[skip=1em]{caption}
\RequirePackage{subcaption}
% Arrays
\RequirePackage{array}
\RequirePackage{booktabs}
\RequirePackage{multirow}
\RequirePackage{multicol}
% Bibliography
\RequirePackage[
backend=biber,
style=numeric-comp,
sorting=none,
maxbibnames=99,
backref=true
]{biblatex}
%%%%%%%%%%%%
% Settings %
%%%%%%%%%%%%
% Parindent
\DeclareOption{parindent}{
\restoreparindent
}
% Style
\geometry{top=3.5cm,bottom=2.5cm,right=2.5cm,left=2.5cm}
\pagestyle{fancy}
\fancyhead[L]{}
\fancyhead[R]{\leftmark}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\DeclareOption{noheader}{
\fancyhead[R]{}
\newgeometry{margin=2.5cm}
}
% Arrays
\renewcommand{\arraystretch}{1.1}
% Bibliography
\DefineBibliographyStrings{english}{
backrefpage = {page},