\documentclass{thesis}
\thesisauthor{John Student}
\thesistitle{A Template}
\thesissubtitle{For a Computer Science Thesis}
\thesisyear{2024}
\thesissupervisor{Prof.\ Dr.\ First Supervisor \and Prof.\ Dr.\ Second Supervisor \and Dr.\ Third Supervisor}
\thesistype{Bachelor's Thesis}
%% PhD Thesis only
% \thesistype{phd}
% \phdnumber{11011}
% \phdcitizen{Switzerland}
% \phdbday{January 1, 1990}
% \phdedu{Master of Computer Science, ETH Zurich}
\begin{document}
\maketitle
\thesisfrontmatter
\begin{abstract}
This document gives an overview about how to use this template.
Whats more, I try to give some more general remarks on how to write a thesis.
Nothing here is set in stone, everything can be debated; but I am happy if
you get some inspirations about what to do and what not to do when
preparing your thesis.
Feel free to use the \texttt{cls} file in any way you want, and maybe consider
taking a look at the \texttt{tex} file before starting.
\end{abstract}
%% Doctoral Thesis only
% \begin{zusammenfassung}
% Doctoral theses at ETH have to contain a German abstract.
% \end{zusammenfassung}
\chapter*{Acknowledgement}
Thank the people who helped you on your journey, both academically and
personally~--~but don't overdo it.
A three-pages Acknowledgements section for a Bachelor's thesis may seem
awkward. Then again, also make sure to not forget anyone.
\tableofcontents
\thesismainmatter
\chapter{Introduction}\label{chap:intro}
This is an example file in which some basic macros are introduced, such as \nat,
\integer, \rat, or \real for sets of numbers; if we only refer to positive
numbers, we write \natp, \integerp, \ratp, or \realp instead. \algA and \algB denote
some algorithms, \ie, finite descriptions of methods to solve given problems.
With $\cost{\algA}$ we mean the cost of \algA, and $\gain{\algB}$ is the gain
of \algB. $\prob{X}$ is the probability of an event $X$, and $\E{Y}$ is the
expected value of a random variable $Y$. The big-Oh notation is, \eg, written
as $\compO{n^2}$, $\compOm{\log n}$, and so on.
This document is divided into chapters and sections, only to demonstrate how
to reference different parts of the document; their names have nothing to do
with their content. The headlines were just chosen this way to propose a possible
way of how to structure your thesis. \Cref{chap:prelim} contains some
remarks about the bibliography; \cref{chap:results} first and foremost includes
\cref{sec:results_upper,sec:results_lower}. You can, however, skim trough it
to see some examples of theorems and definitions, \eg,
\cref{def:algorithm,thm:something}. As you can see, we use
\texttt{$\backslash$cref} instead of \texttt{$\backslash$ref}. ``This'' is how
to put quotation marks around something; ''these'' look bad, "these" look even
worse.
In Texten auf Schweizerdeutsch verwenden wir wiederum <> Anf\"uhrungszeichen.
To start a new paragraph, we add an empty line to the source code. We avoid
using \texttt{$\backslash\backslash$} except for tables or formulae.
This would be what we want. In particular, we never use the double backslash
in such a case.
Equations are typeset as
\[ x^2+y^2=z^2 \]
or
\begin{equation}\label{eq:eulers_id}
\text{e}^{i\pi} + 1 = 0
\end{equation}
if we want to refer to them, such as \cref{eq:eulers_id}.
For equivalences and implications, we use
\[ A\implies B, \quad A\impliedby B, \quad \text{ and } A\iff B\;. \]
Note that there is a small space between the formulae and the full stop.
This is to make sure that no one mixes up
\[ \frac{1}{\algB} \]
and
\[ \frac{1}{\algA}, \]
which could easily happen, right?
If we define a function, we write, \eg,
\[ f\colon \natp\to\realp \]
instead of
\[ f: \natp\to\realp\;, \]
because the latter has a spacing that suggests division, such as $a:b$.
To define the concrete function, we can write
\[ f\colon x\mapsto 3x+5\;. \]
Note that we use $\mapsto$ instead of $\to$ in this case.
Expressions that have multiple lines are typeset as
\begin{align*}
1+2+\dots+n & = \sum_{i=1}^n \\
& = \frac{n(n+1)}{2} \\
& = \frac{n^2+n}{2} \;,
\end{align*}
and we note that there is no double backslash in the last line. If we
want to refer to single lines, we do this by
\begin{align}
\binom{n}{k} & = \frac{n!}{k!\cdot (n-k)!} \nonumber\\
& = \frac{n!}{(n-n+k)!\cdot (n-k)!} \nonumber\\
& = \frac{n!}{(n-(n-k))!\cdot (n-k)!} \label{eq:binom}\\
& = \binom{n}{n-k} \nonumber
\end{align}
and refer to the third line by \cref{eq:binom}. Multiple equivalence operations
are typeset as
\begin{alignat*}{3}
&& (\sin \alpha)^2 + (\cos \alpha)^2 & = 1 \\
\iff\quad && (\sin \alpha)^2 & = 1 - (\cos \alpha)^2 \\
\iff\quad && \sin \alpha & = \pm\sqrt{1 - (\cos \alpha)^2} \;.
\end{alignat*}
We continue in the next chapter.
\chapter{Preliminaries}\label{chap:prelim}
If we use a bibliography that exceeds a few items, we should use \texttt{bibtex}
to manage them. In this example, we don't, because we only want to demonstrate
a few points that are independent of the system used to manage the references.
When citing something, we should avoid using the reference as a word, \ie, writing
something like ``see \cite{Tur1936}'' or ``as shown in \cite{Coo1971}.\!'' It
is not an absolute faux pas to do so, but rather treat the brackets as what they
are, and write ``as shown by Turing \cite{Coo1971}.\!'' If a paper is written by
two authors, we write both their names; if there are more, we only mention the first
one, \eg, Rivest et al.\ \cite{RSA1978}. Note that we spelled out the given names
of the authors listed in the bibliography. This is not the default setting, unfortunately;
but I would like to encourage you to do so (if it is up to you).
There is a difference between a plain point and a full stop in that \TeX\ puts more
space behind the latter. If a point is not supposed to be full stop, we indicate
this by an explicit inter-word space. We did so above behind the ``et al.\!''
\section{Some Definitions}\label{sec:defs}
We usually try to avoid having two headlines directly below of each other; there should
be some text in between.
Definitions, theorems, lemmata etc.\ (again the explicit inter-word space) are typeset
using the corresponding environments.
\begin{definition}[Algorithm]\label{def:algorithm}
\lipsum[6]
\end{definition}
\begin{definition}[Greedy Algorithm]
\lipsum[2]
\end{definition}
Figures are put into the specific environments. There are multiple ways to draw pictures,
but you should be careful to choose one that is able create vector graphics.
We recommend \texttt{TikZ} as it nicely interacts with \LaTeX. An example is shown
in \cref{fig:geometry}. Note that the figure is displayed on the top of the page.
This should not be changed, although it seems tempting to place figures where they are
referenced. Furthermore, note that the label is placed below the caption. Tables should
be treated similar; some more details are given in \cref{chap:results}.
\begin{figure}
\begin{center}
\begin{tikzpicture}
\draw[thick] (-1,0) rectangle (4,1.5);
\draw[thick,densely dotted] (2,1) -- (5,1) -- (3.5,3.5) -- cycle;
\draw[thick] (3,1) circle (15mm);
\end{tikzpicture}
\end{center}
\caption{Some geometric primitives.}
\label{fig:geometry}
\end{figure}
\section{Basic Observations}
There is a special environment for case distinctions. This also allows you to define
subcases, and can be used as follows.
\begin{casedist}
\case \lipsum[66]
\case Here, we distinguish two subcases.
\begin{subcasedist}
\subcase \lipsum[75]
\subcase \lipsum[101]
\end{subcasedist}
\case \lipsum[3]
\end{casedist}
\chapter{Results}\label{chap:results}
Again, no two headlines are placed directly below of each other; it is recommended
to use this space to give a small high-level summary of what is covered in the following
sections.
\section{Upper Bounds}\label{sec:results_upper}
In what follows, you see how to typeset a theorem and its proof. Note that
the qed-symbol is placed at the end automatically.
\begin{theorem}\label{thm:something}
\lipsum[3]
\end{theorem}
\begin{proof}
\lipsum[4-8]\
\end{proof}
\section{Lower Bounds}\label{sec:results_lower}
Here, we have a lemma and a corollary instead of a theorem. Since the corollary has
no proof, the qed-symbol is manually placed at its end.
\begin{theorem}
\lipsum[12]
\end{theorem}
\begin{proof}
\lipsum[13-14]\
\end{proof}
\begin{corollary}
\lipsum[15]
\qed
\end{corollary}
\section{Further Considerations}
As mentioned in \cref{sec:defs}, tables are also always at the top of a page. An example
is shown in \cref{tab:functions}. In contrast to figures, the captions of tables are
displayed above the tables and not below. Again, the label is placed below the caption.
Tables never use vertical lines, but only horizontal ones.
\begin{table}
\caption{Different functions}
\label{tab:functions}
\begin{center}
\begin{tabular}{rcccc}
\toprule
$n$ & $10$ & $100$ & $200$ & $1\,000$ \\
\midrule
$\log_{10} n$ & $1$ & $2$ & $\approx 2.30$ & $3$ \\
$3n$ & $30$ & $300$ & $600$ & $3\,000$ \\
$n^2$ & $100$ & $10\,000$ & $40\,000$ & $100\,000$ \\
$n^3+n/2$ & $1\,005$ & $1\,000\,050$ & $8\,000\,100$ & $100\,000\,500$ \\
\bottomrule
\end{tabular}
\end{center}
\end{table}
Note that we inserted small spaces behind blocks of three consecutive digits, \eg,
we wrote $10\,000$ instead of $10000$, to make them easier to parse.
\chapter{Conclusion}
\lipsum[1-5]
\thesisbackmatter
\begin{thebibliography}{10}
\bibitem{Coo1971}
Stephen A.~Cook.
\newblock The complexity of theorem-proving procedures.
\newblock In \emph{Proceedings of the 3rd Annual ACM Symposium on Theory of
Computing (STOC~1971)}, pages 151--158. Association for Computing Machinery, 1971.
\bibitem{RSA1978}
Ronald L.~Rivest, Adi Shamir, and Leonard M.~Adleman.
\newblock A method for obtaining digital signatures and public-key cryptosystems.
\newblock \emph{Communications of the ACM} 21(2):120--126, 1978.
\bibitem{Tur1936}
Alan M.~Turing.
\newblock On computable numbers, with an application to the Entscheidungsproblem.
\newblock In \emph{Proceedings of the London Mathematical Society}, 42(2):230--265, 1936.
\end{thebibliography}
\declaration
\end{document}