\documentclass[a4paper,12pt]{report}
%%%%%%%%%%%%
% Packages %
%%%%%%%%%%%%
\usepackage[english]{babel}
\usepackage{sleek}
\usepackage{sleek-title}
\usepackage{sleek-theorems}
\usepackage{sleek-listings}
%%%%%%%%%%%%%%
% Title-page %
%%%%%%%%%%%%%%
\logo{./resources/pdf/logo.pdf}
\institute{Random University}
\faculty{Faculty of Whatever Sciences}
%\department{Department of Anything but Psychology}
\title{A sleek \LaTeX{} template}
\subtitle{With a sleeker title-page}
\author{\textit{Author}\\François \textsc{Rozet}}
%\supervisor{Linus \textsc{Torvalds}}
%\context{A long time ago in a galaxy far, far away...}
\date{\today}
%%%%%%%%%%%%%%%%
% Bibliography %
%%%%%%%%%%%%%%%%
\addbibresource{./resources/bib/references.bib}
%%%%%%%%%%
% Macros %
%%%%%%%%%%
\def\tbs{\textbackslash}
%%%%%%%%%%%%
% Document %
%%%%%%%%%%%%
\begin{document}
\maketitle
\clearpage
\pagenumbering{roman}
\tableofcontents
\clearpage
\pagenumbering{arabic}
\chapter{Introduction}
Sleek Template is a minimal collection of \LaTeX{} 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. As such the template is compatible with many document classes, such as \texttt{article}, \texttt{report} or \texttt{book}.
\begin{lstlisting}[style=ruled, language=latex, gobble=4]
\documentclass[a4paper,12pt,twoside,openany]{book}
\end{lstlisting}
The template is composed of four separate packages which can be used individually: \texttt{sleek}, \texttt{sleek-title}, \texttt{sleek-theorems} and \texttt{sleek-listings}.
\begin{lstlisting}[style=ruled, language=latex, caption={Example of Sleek Template packages usage.}, gobble=4]
\usepackage[english]{babel}
\usepackage{sleek}
\usepackage{sleek-title}
\end{lstlisting}
\blindfootnote{If you are a \LaTeX{} beginner, consider the excellent tutorial \citetitle{overleaf}, \textcite{overleaf}. Also, there are a lot of symbols available in \LaTeX{} and, therefore, in this template. I recommend the use of \citetitle{pakin2020comprehensive}, \textcite{pakin2020comprehensive} for searching symbols.}
\chapter{Features}
\section{\texttt{sleek}}
\texttt{sleek} is the main package. It imports the packages (see Table \ref{tab:sleek_relevant_packages}) and setups the settings that make Sleek Template easy to use. The package provides two options:
\begin{enumerate}[noitemsep]
\item \texttt{header} adds a header with the current chapter to pages;
\item \texttt{french} makes the French setup consistent with other languages.
\end{enumerate}
However, nothing prevents you from tweaking the settings to your liking in the source code. For example, you can change the font of the document from \enquote{Linux Libertine} to \enquote{Latin Modern Roman}, by replacing
\begin{lstlisting}[style=ruled, language=latex, gobble=4]
% Font
\RequirePackage{libertine}
\RequirePackage{libertinust1math}
\RequirePackage[T1]{fontenc}
\end{lstlisting}
with
\begin{lstlisting}[style=ruled, language=latex, gobble=4]
% Font
\RequirePackage{lmodern}
\RequirePackage[T1]{fontenc}
\end{lstlisting}
in the \texttt{sleek.sty} file.
\subsection{Mathematics}
This template uses \texttt{amsmath} and \texttt{amssymb}, which are the de-facto standard for typesetting mathematics. Additionally, \texttt{esint} provides alternative integral symbols (see Table 78 in \cite{pakin2020comprehensive}) and \texttt{bm} is used for bold math symbols like vectors (see \eqref{eq:gauss_law}).
A few custom macros have also been added such as \texttt{\tbs{}rbk}, \texttt{\tbs{}sbk} and \texttt{\tbs{}cbk} for respectively round, square and curly brackets or \texttt{\tbs{}abs} for absolute value. Here follows some examples showcasing what is possible with the default packages of \texttt{sleek}.
\[
\rbk*{\pi}, \quad \sbk*{\frac{\pi}{2}}, \quad \cbk*{\pi=3 + \frac{1}{7 + \frac{1}{15 + \frac{1}{1 + \dots}}}}, \quad \abs{2 \pi}, \quad \norm{\frac{\pi}{4}}, \quad \ceil[\big]{\frac{22}{7}}, \quad \floor[\Big]{\frac{\pi^2}{6}}
\]
\begin{equation}\label{eq:gauss_law}
\oiint_S \bm{E} \cdot \d{\bm{s}} = \iiint_V \frac{\rho}{\varepsilon_0} \d{V}
\end{equation}
\begin{equation*}
e = \sum_{n=0}^\infty \frac{1}{\fact{n}}
\end{equation*}
\begin{subequations}
\begin{align}
\frac{\d{x}}{\d{t}} & = \alpha x - \beta xy \\
\frac{\d{y}}{\d{t}} & = \delta xy - \gamma y
\end{align}
\end{subequations}
\begin{align*}
\ln \abs{x} + C & = \int \frac{1}{x} \d{x} \\
\exp(x) & = \lim_{n \to \infty} \rbk*{1 + \frac{x}{n}}^n
\end{align*}
\begin{equation}
\left\{
\begin{aligned}
x & = r \sin \theta \cos \phi \\
y & = r \sin \theta \sin \phi \\
z & = r \cos \theta
\end{aligned}
\right.
\end{equation}
\begin{alignat*}{2}
& & P(A, B) & = P(A \mid B) P(B) \\
\Leftrightarrow \quad & & P(A \mid B) & = \frac{P(A, B)}{P(B)} \\
& & & = P(B \mid A) \frac{P(A)}{P(B)}
\end{alignat*}
\subsection{Units}
The \texttt{siunitx} package \cite{wright2022siunitx} provides three commands to typeset numbers, units and quantities: \texttt{\tbs{}num}, \texttt{\tbs{}unit} and \texttt{\tbs{}qty}.
It is possible to write, both in text or math modes, numbers without units (\eg{} \num{1}, \num{1.0}, \num{-1}, \num{3.14159}, \num{e100}, $N_A = \num{6.022e23}$), units without quantity (\eg{} $\unit{\joule} = \unit{\newton\meter} = \unit{\kilogram\meter\squared\per\second\squared}$) and, finally, quantities with their units (\eg{} \qty{9.81}{\meter\per\second\squared}, $c = \qty{299.6e6}{\meter\per\second}$).
\subsection{Lists}
Sleek Template uses \texttt{enumitem} to enhance the listing capabilities of \LaTeX{}. There are several lists environments:
\begin{itemize}[noitemsep]
\item \texttt{itemize} for unordered lists;
\item \texttt{enumerate} for ordered lists;
\item \texttt{description} for descriptive lists.
\end{itemize}
In a list, each element is preceded by the command \texttt{\tbs{}item}. It is possible to modify the labels
\begin{enumerate*}
\item individually with \texttt{\tbs{}item[newLabel]} or
\item for the whole environment with the \texttt{label=newLabel} option.
\end{enumerate*}
In the case of \texttt{enumerate}, \texttt{newLabel} can contain special expressions (see Table \ref{tab:enumerate_special_expressions}) that will adapt to the item number. For example, \texttt{label=(\tbs{}alph*)} defines the label sequence \enquote{(a), (b), (c), ...}. Still in the case of \texttt{enumerate}, the \texttt{\tbs{}setcounter} and \texttt{\tbs{}addtocounter} commands allow to modify the current item number.
One could want to reduce the space between items with the \texttt{noitemsep} option or to delete the left margin with the \texttt{leftmargin=*} option.
It is also possible to write nested lists. Here follows a very condensed example.
\begin{itemize}[leftmargin=*]
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Arcu ac tortor dignissim convallis aenean et tortor. In eu mi bibendum neque egestas congue quisque.
\item[$+$] Semper quis lectus nulla at volutpat diam ut. Felis eget velit aliquet sagittis id. Blandit aliquam etiam erat velit scelerisque in dictum non consectetur.
\begin{equation}
a^2 + b^2 = c^2
\end{equation}
\item Nibh sed pulvinar proin gravida hendrerit lectus. Pretium aenean pharetra magna ac placerat vestibulum lectus mauris. Non consectetur a erat nam at lectus urna duis.
\begin{enumerate}[noitemsep, label=\roman*.]
\item Nibh tortor id aliquet lectus. Sit amet justo donec enim diam vulputate ut pharetra sit.
\setcounter{enumi}{3}
\item Condimentum id venenatis a condimentum vitae. Quis eleifend quam adipiscing vitae proin sagittis nisl.
\addtocounter{enumi}{15}
\item Proin sagittis nisl rhoncus mattis rhoncus urna neque viverra.
\end{enumerate}
\item Elit scelerisque mauris pellentesque pulvinar pellentesque habitant morbi tristique senectus.
\begin{description}
\item[Ridiculus] mus mauris vitae ultricies leo. Mollis aliquam ut porttitor leo a diam. Velit egestas dui id ornare arcu odio ut sem nulla.
\item[Nullam vehicula] ipsum a arcu. Nibh sit amet commodo nulla facilisi nullam. At erat pellentesque adipiscing commodo elit. Libero volutpat sed cras ornare arcu dui.
\end{description}
\end{itemize}
\subsection{Figures}
Thanks to the \texttt{graphicx} package, it is possible to include external graphic documents (images, plots, etc.) in your document with the \texttt{\tbs{}includegraphics} command. Most image type format (\texttt{jpg}, \texttt{png}, \texttt{bmp}, etc.) are supported by this command. However, it should be noted that it is highly preferable to use vectorial types, such as \texttt{pdf} or \texttt{eps}.
\begin{figure}[h]
\centering
\includegraphics[width=0.5\textwidth]{resources/pdf/logo.pdf}
\caption{Random University logo.}
\label{fig:random_university_logo}
\end{figure}
\subsection{Tables}
The \texttt{multirow} package comes handy for complex table formatting such as multi-column or multi-row cells.
\begin{table}[H]
\centering
\begin{tabular}{|r|r|c|l|}
\hline
\multicolumn{3}{|l|}{a} & qrs \\ \hline
b & ef & jkl & tuvx \\ \hline
cd & ghi & mnop & wyz \\ \hline
\end{tabular}
\caption{Example of multi-column cells.}
\label{tab:multicol_example}
\end{table}
\begin{table}[H]
\centering
\begin{tabular}{|l|c|r|}
\hline
\multirow{3}{2cm}{a} & b & c \\ \cline{2-3}
& de & fg \\ \cline{2-3}
& hij & klm \\ \hline
nopq & rstuv & wxyz \\ \hline
\end{tabular}
\caption{Example of multi-row cells.}
\label{tab:multirow_example}
\end{table}
The \texttt{booktabs} package also provides tools to build publication-ready tables. The tables in Appendix \ref{chap:Tables} are good examples.
\clearpage
\section{\texttt{sleek-title}}
Sleek Template offers a custom title-page with the package \texttt{sleek-title}. The formatting of the title-page is automatically inferred from the fields that the user has provided.
The fields are \texttt{\tbs{}logo}, \texttt{\tbs{}institute}, \texttt{\tbs{}faculty}, \texttt{\tbs{}department}, \texttt{\tbs{}title}, \texttt{\tbs{}subtitle}, \texttt{\tbs{}author}, \texttt{\tbs{}supervisor}, \texttt{\tbs{}context} and \texttt{\tbs{}date}.
Among these, only \texttt{\tbs{}title}, \texttt{\tbs{}author} and \texttt{\tbs{}date} have to be provided. However, none of the fields should stay empty. Prefer deleting or commenting the line if so.
\begin{lstlisting}[style=ruled, language=latex, caption={Example of \texttt{sleek-title} title-page definition.}, gobble=4]
\logo{./resources/pdf/logo.pdf}
\institute{Random University}
\faculty{Faculty of Whatever Sciences}
%\department{Department of Anything but Psychology}
\title{A sleek \LaTeX{} template}
\subtitle{With a sleeker title-page}
\author{\textit{Author}\\Francois \textsc{Rozet}}
%\supervisor{Linus \textsc{Torvalds}}
%\context{A long time ago in a galaxy far, far away...}
\date{\today}
\end{lstlisting}
It is also possible to use Sleek Template without \texttt{sleek-title}, in which case the default \LaTeX{} title-page will be used.
\clearpage
\section{\texttt{sleek-theorems}}
\texttt{sleek-theorems} is based on the \texttt{amsthm} and \texttt{thmtools} packages. It provides a handful of theorem-like environments, each of which have different style and purpose: \texttt{theorem}, \texttt{lemma}, \texttt{proposition}, \texttt{proof}, \texttt{definition}, \texttt{hypothesis}, \texttt{method}, \texttt{question}, \texttt{answer}, \texttt{example}, \texttt{remark}, \texttt{note} and \texttt{tip}.
\begin{note}
The \texttt{french} and \texttt{german} options translate the names of the provided environments. It is also possible, and easy, to add your own language as an option in the source code.
\end{note}
\begin{theorem}[Triangle inequality]
Let be a triangle in Euclidean space. Then the sum of the lengths of two of its sides always surpass or equals the length of the third.
\end{theorem}
\begin{proof}
Let $a$, $b$ and $c$ be the lengths of the sides of a triangle in Euclidean space and $\alpha$, $\beta$, $\gamma$ their respective opposite angle. By the generalized Pythagoras' theorem, we have
\begin{alignat*}{2}
& & c^2 & = a^2 + b^2 - 2ab \cos\gamma \\
& & & \leq a^2 + b^2 + 2ab \\
& & & \leq (a + b)^2 \\
\Leftrightarrow \quad & & c & \leq a + b
\end{alignat*}
Therefore in any triangle, the sum of the lengths of two sides always surpass or equals the length of the third. \qed
\end{proof}
In addition, these environments also have framed versions -- \texttt{fmd-theorem}, \texttt{fmd-lemma}, etc. -- for better encapsulation.
\begin{fmd-theorem}[Triangle inequality]\label{thm:Triangle inequality}
Let be a triangle in Euclidean space. Then the sum of the lengths of two of its sides always surpass or equals the length of the third.
\end{fmd-theorem}
\begin{fmd-proof}
Let $a$, $b$ and $c$ be the lengths of the sides of a triangle in Euclidean space and $\alpha$, $\beta$, $\gamma$ their respective opposite angle. By the generalized Pythagoras' theorem, we have
\begin{alignat*}{2}
& & c^2 & = a^2 + b^2 - 2ab \cos\gamma \\
& & & \leq a^2 + b^2 + 2ab \\
& & & \leq (a + b)^2 \\
\Leftrightarrow \quad & & c & \leq a + b
\end{alignat*}
Therefore in any triangle, the sum of the lengths of two sides always surpass or equals the length of the third. \qed
\end{fmd-proof}
\begin{fmd-question*}
Based on the theorem \ref{thm:Triangle inequality}, what is the shortest path from a point $A$ to a point $B$ in Euclidean geometry ?
\end{fmd-question*}
\clearpage
\section{\texttt{sleek-listings}}
The \texttt{sleek-listings} package is a small collection of styles and languages for the \texttt{listings} package, which is useful to showcase nicely samples of code. The package provides the styles \texttt{default}, \texttt{numbered}, \texttt{framed}, \texttt{ruled}, \texttt{framednumbered} and \texttt{rulednumbered} and the languages \texttt{latex}, \texttt{c*}, \texttt{cpp*}, \texttt{matlab*}, \texttt{python*}, \texttt{java*} and \texttt{scheme}, with a simple color scheme for keywords and comments.
For instance, if you want to showcase Python code within a ruled code block (top and bottom rule) with line numbers, you can either import a \texttt{.py} file with
\begin{lstlisting}[style=ruled, language=latex, gobble=4]
\lstinputlisting[style=rulednumbered, language=python*]{filename.py}
\end{lstlisting}
or paste the code within the \LaTeX{} document as
\begin{lstlisting}[style=rulednumbered, language=python*, gobble=4]
import numpy as np # Unnecessary import
a, b = 69., .420
def f(a: float, b: float) -> float:
r"""Sum two numbers
Parameters
----------
a: first number
b: second number
Returns
-------
the sum of 'a' and 'b'
"""
return a + b
c = f(a, b)
print('{:f} + {:f} equals {:f}'.format(a, b, c))
\end{lstlisting}
\printbibliography
\appendix
\chapter{Tables} \label{chap:Tables}
\begin{table}[h]
\centering
\begin{tabular}{ll}
\toprule
\textbf{Package} & \textbf{Purpose} \\
\midrule
\texttt{amsmath} & Mathematical typesetting \\
\texttt{amsthm} & Mathematical environments for theorems, proofs, etc. \\
\texttt{booktabs} & Weighted rules for tables \\
\texttt{biblatex} & Bibliography \\
\texttt{csquotes} & Inline and display quotations \\
\texttt{enumitem} & Lists and enumerations \\
\texttt{float} & Floating objects such as figures and tables \\
\texttt{graphicx} & Graphics \\
\texttt{hyperref} & Hyperlinks and bookmarks \\
\texttt{listings} & Code listings \\
\texttt{multirow} & Table cells that span multiple columns or rows \\
\texttt{siunitx} & Typesetting of units \\
\texttt{subcaption} & Sub-figures and sub-captions \\
\bottomrule
\end{tabular}
\caption{List of the most relevant packages imported by Sleek Template.}
\label{tab:sleek_relevant_packages}
\end{table}
\begin{table}[h]
\centering
\begin{tabular}{>{\ttfamily}ll}
\toprule
\{\tbs{}rmfamily abcABC123\} & {\rmfamily abcABC123} \\
\{\tbs{}sffamily abcABC123\} & {\sffamily abcABC123} \\
\{\tbs{}ttfamily abcABC123\} & {\ttfamily abcABC123} \\
\{\tbs{}mdseries abcABC123\} & {\mdseries abcABC123} \\
\{\tbs{}bfseries abcABC123\} & {\bfseries abcABC123} \\
\{\tbs{}itshape abcABC123\} & {\itshape abcABC123} \\
\{\tbs{}scshape abcABC123\} & {\scshape abcABC123} \\
\{\tbs{}slshape abcABC123\} & {\slshape abcABC123} \\
\{\tbs{}upshape abcABC123\} & {\upshape abcABC123} \\
\midrule
\tbs{}emph\{abcABC123\} & \emph{abcABC123} \\
\tbs{}lowercase\{abcABC123\} & \lowercase{abcABC123} \\
\tbs{}normalfont\{abcABC123\} & \normalfont{abcABC123} \\
\tbs{}textrm\{abcABC123\} & \textrm{abcABC123} \\
\tbs{}textbf\{abcABC123\} & \textbf{abcABC123} \\
\tbs{}textit\{abcABC123\} & \textit{abcABC123} \\
\tbs{}textsc\{abcABC123\} & \textsc{abcABC123} \\
\tbs{}textsf\{abcABC123\} & \textsf{abcABC123} \\
\tbs{}textsl\{abcABC123\} & \textsl{abcABC123} \\
\tbs{}textsubscript\{abcABC123\} & \textsubscript{abcABC123} \\
\tbs{}textsuperscript\{abcABC123\} & \textsuperscript{abcABC123} \\
\tbs{}texttt\{abcABC123\} & \texttt{abcABC123} \\
\tbs{}underline\{abcABC123\} & \underline{abcABC123} \\
\tbs{}uppercase\{abcABC123\} & \uppercase{abcABC123} \\
\bottomrule
\end{tabular}
\caption{Available text fonts in \LaTeX{}.}
\label{tab:text_fonts}
\end{table}
\begin{table}[h]
\centering
\begin{tabular}{>{\ttfamily\$}l<{\$}l}
\toprule
\tbs{}mathcal\{abcABC123\} & $\mathcal{abcABC123}$ \\
\tbs{}mathit\{abcABC123\} & $\mathit{abcABC123}$ \\
\tbs{}mathnormal\{abcABC123\} & $\mathnormal{abcABC123}$ \\
\tbs{}mathrm\{abcABC123\} & $\mathrm{abcABC123}$ \\
\tbs{}mathbb\{abcABC123\} & $\mathbb{abcABC123}$ \\
\tbs{}mathfrak\{abcABC123\} & $\mathfrak{abcABC123}$ \\
\bottomrule
\end{tabular}
\caption{Available math fonts in \LaTeX{} and AMS.}
\label{tab:math_fonts}
\end{table}
\begin{table}[h]
\centering
\begin{tabular}{ll}
\toprule
\textbf{Expression} & \textbf{Description} \\
\midrule
\texttt{\tbs{}arabic*} & Arabic numbers (1, 2, 3, ...) \\
\texttt{\tbs{}alph*} & Lowercase letters (a, b, c, ...) \\
\texttt{\tbs{}Alph*} & Uppercase letters (A, B, C, ...) \\
\texttt{\tbs{}roman*} & Lowercase Roman numerals (i, ii, iii, ...) \\
\texttt{\tbs{}Roman*} & Uppercase Roman numerals (I, II, III, ...) \\
\bottomrule
\end{tabular}
\caption{Special expressions for the label of \texttt{enumerate} environments.}
\label{tab:enumerate_special_expressions}
\end{table}
\end{document}

PDF Preview
Create an account to compile and preview