Skip to content

Commit

Permalink
Merge branch 'hirsch-lab-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
matteodelucchi committed Oct 19, 2022
2 parents 5f6bd35 + e5bfa73 commit 912f982
Show file tree
Hide file tree
Showing 24 changed files with 945 additions and 630 deletions.
22 changes: 9 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
# vscode
.vscode/*
# VS code
*.code-workspace
.history/

## Core latex/pdflatex auxiliary files:
# LaTeX/XeLaTeX temporary files
*.aux
*.lof
*.log
*.lot
*.toc
*.bcf
*.run.xml
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
.*.lb

# PDF output - usually a bad idea to keep this in Git
main.pdf

## Intermediate documents:
*.dvi
Expand Down Expand Up @@ -303,4 +299,4 @@ TSWLatexianTemp*
# REVTeX puts footnotes in the bibliography by default, unless the nofootinbib
# option is specified. Footnotes are the stored in a file with suffix Notes.bib.
# Uncomment the next line to have this generated file ignored.
#*Notes.bib
#*Notes.bib
6 changes: 5 additions & 1 deletion Appendices/AppendixA.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
% Appendix A
% !TEX root = ../main.tex

%----------------------------------------------------------------------------------------
% APPENDIX A
%----------------------------------------------------------------------------------------

\chapter{Frequently Asked Questions} % Main appendix title

Expand Down
8 changes: 6 additions & 2 deletions Appendices/AppendixTemplate.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
% Appendix Template
% !TEX root = ../main.tex

%----------------------------------------------------------------------------------------
% APPENDIX TEMPLATE
%----------------------------------------------------------------------------------------

\chapter{Appendix Title Here} % Main appendix title

\label{ApendixX} % Change X to a consecutive letter; for referencing this appendix elsewhere, use \ref{AppendixX}

Write your Appendix content here.
Write your Appendix content here.
18 changes: 15 additions & 3 deletions Appendices/DeclarationOfOriginalityZHAW.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
% Appendix: Declaration of Originality
% !TEX root = ../main.tex

\chapter{Declaration of Originality} % Main appendix title
%----------------------------------------------------------------------------------------
% APPENDIX: DECLARATION OF ORIGINALITY
%----------------------------------------------------------------------------------------

\label{DeclarationOfOriginalityZHAW} % For referencing this appendix elsewhere, use \ref{AppendixA}
% Include the official "Plagiatserklärung" as a PDF

% Ensure that a TOC entry is create while suppressing the chapter header
\cleardoublepage
\phantomsection
\addtocounter{chapter}{1}
\addcontentsline{toc}{chapter}{\protect\numberline{\thechapter} Declaration of Originality}
% The above replaces this command (which creates a chapter header).
%\chapter{Declaration of Originality} % Main appendix title
\label{DeclarationOfOriginalityZHAW}

% Include a PDF (full page)
\includepdf[pages=-]{Appendices/plagiatserklaerung-master-eng.pdf}
62 changes: 36 additions & 26 deletions Chapters/Chapter1.tex
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
% Chapter 1
% Indicate the main file. Must go at the beginning of the file.
% !TEX root = ../main.tex

%----------------------------------------------------------------------------------------
% CHAPTER 1
%----------------------------------------------------------------------------------------

\chapter{Chapter Title Here} % Main chapter title


\chapter{Introduction to \LaTeX} % Main chapter title
\label{Chapter1} % For referencing the chapter elsewhere, use \ref{Chapter1}

%----------------------------------------------------------------------------------------

% Define some commands to keep the formatting separated from the content
% Define some commands to keep the formatting separated from the content
% Placing such commands in the preamble is a good idea.
\newcommand{\keyword}[1]{\textbf{#1}}
\newcommand{\tabhead}[1]{\textbf{#1}}
\newcommand{\code}[1]{\texttt{#1}}
Expand Down Expand Up @@ -41,9 +48,10 @@ \subsection{A (not so short) Introduction to \LaTeX{}}

\subsection{A Short Math Guide for \LaTeX{}}

If you are writing a technical or mathematical thesis, then you may want to read the document by the AMS (American Mathematical Society) called, \enquote{A Short Math Guide for \LaTeX{}}. It can be found online here:
\url{http://www.ams.org/tex/amslatex.html}
under the \enquote{Additional Documentation} section towards the bottom of the page.
If you are writing a technical or mathematical thesis, then you may want to read the document by the AMS (American Mathematical Society) called, \enquote{A Short Math Guide for \LaTeX{}}. It can be found online:

\url{http://www.ams.org/tex/amslatex.html} $\rightarrow$ \enquote{Additional Documentation}\\
\url{https://mirror.foobar.to/CTAN/info/short-math-guide/}

\subsection{Common \LaTeX{} Math Symbols}
There are a multitude of mathematical symbols available for \LaTeX{} and it would take a great effort to learn the commands for them all. The most common ones you are likely to use are shown on this page:
Expand Down Expand Up @@ -75,7 +83,8 @@ \subsection{About this Template}
Steve's \file{ecsthesis.cls} was then taken by Sunil Patel who modified it by creating a skeleton framework and folder structure to place the thesis files in. The resulting template can be found on Sunil's site here:
\url{http://www.sunilpatel.co.uk/thesis-template}

Sunil's template was made available through \url{http://www.LaTeXTemplates.com} where it was modified many times based on user requests and questions. Version 2.0 and onwards of this template represents a major modification to Sunil's template and is, in fact, hardly recognisable. The work to make version 2.0 possible was carried out by \href{mailto:vel@latextemplates.com}{Vel} and Johannes Böttcher.

Sunil's template was made available through \url{http://www.LaTeXTemplates.com}, where it was modified many times based on user requests and questions. Version 2.0 and onwards of this template represents a major modification to Sunil's template and is, in fact, hardly recognisable. The work to make version 2.0 possible was carried out by \href{mailto:vel@latextemplates.com}{Vel} and Johannes Böttcher.

Based on Sunil's Version 2.0, Matteo updated the template and incorporated ZHAW University thesis guidelines.

Expand Down Expand Up @@ -179,7 +188,7 @@ \section{Thesis Features and Conventions}\label{ThesisConventions}

\subsection{Printing Format}

This thesis template is designed for double sided printing (i.e. content on the front and back of pages) as most theses are printed and bound this way. Switching to one sided printing is as simple as uncommenting the \option{oneside} option of the \code{documentclass} command at the top of the \file{main.tex} file. You may then wish to adjust the margins to suit specifications from your institution.
This thesis template is designed for double sided printing (i.e. content on the front and back of pages) as most theses are printed and bound this way. To switch to one sided printing, uncomment the \option{oneside} option of the \code{documentclass} command at the top of the \file{main.tex} file. You may then wish to adjust the margins to suit specifications from your institution.

The headers for the pages contain the page number on the outer side (so it is easy to flick through to the page you want) and the chapter name on the inner side.

Expand Down Expand Up @@ -211,23 +220,24 @@ \subsection{Tables}
Tables are an important way of displaying your results, below is an example table which was generated with this code:

{\small
\begin{verbatim}
\begin{table}
\caption{The effects of treatments X and Y on the four groups studied.}
\label{tab:treatments}
\centering
\begin{tabular}{l l l}
\toprule
\tabhead{Groups} & \tabhead{Treatment X} & \tabhead{Treatment Y} \\
\midrule
1 & 0.2 & 0.8\\
2 & 0.17 & 0.7\\
3 & 0.24 & 0.75\\
4 & 0.68 & 0.3\\
\bottomrule\\
\end{tabular}
\end{table}
\end{verbatim}
\begin{verbatim}
\begin{table}
\caption{The effects of treatments X and Y
on the four groups studied.}
\label{tab:treatments}
\centering
\begin{tabular}{l l l}
\toprule
\tabhead{Groups} & \tabhead{Treatment X} & \tabhead{Treatment Y} \\
\midrule
1 & 0.2 & 0.8\\
2 & 0.17 & 0.7\\
3 & 0.24 & 0.75\\
4 & 0.68 & 0.3\\
\bottomrule\\
\end{tabular}
\end{table}
\end{verbatim}
}

\begin{table}
Expand Down Expand Up @@ -310,7 +320,7 @@ \subsection{Typesetting mathematics}

\section{Sectioning and Subsectioning}

You should break your thesis up into nice, bite-sized sections and subsections. \LaTeX{} automatically builds a table of Contents by looking at all the \verb|\chapter{}|, \verb|\section{}| and \verb|\subsection{}| commands you write in the source.
You should break your thesis up into nice, bite-sized sections and subsections. \LaTeX{} automatically builds a table of contents by looking at all \verb|\chapter{}|, \verb|\section{}| and \verb|\subsection{}| commands you write in the source.

The Table of Contents should only list the sections to three (3) levels. A \verb|chapter{}| is level zero (0). A \verb|\section{}| is level one (1) and so a \verb|\subsection{}| is level two (2). In your thesis it is likely that you will even use a \verb|subsubsection{}|, which is level three (3). The depth to which the Table of Contents is formatted is set within \file{MastersDoctoralThesis.cls}. If you need this changed, you can do it in \file{main.tex}.

Expand Down
57 changes: 57 additions & 0 deletions Chapters/Chapter2.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
% Indicate the main file. Must go at the beginning of the file.
% !TEX root = ../main.tex

%----------------------------------------------------------------------------------------
% CHAPTER 2
%----------------------------------------------------------------------------------------

\chapter{Code Listings}

\label{Chapter2} % For referencing the chapter elsewhere, use \ref{Chapter2}

%----------------------------------------------------------------------------------------

The package \href{https://www.overleaf.com/learn/latex/Code\_listing}{\code{listings}} permits to easily include existing code. Simply use the command \verb|\lstinputlisting[language=name]{path/to/file}|. See \href{https://www.overleaf.com/learn/latex/Code\_listing#Supported\_languages}{here} for a list of supported programming languages.


\lstinputlisting[language=Python,caption=External file: code/example.py]{Code/example.py}

It is also possible to enter code directly into \LaTeX:

\begin{lstlisting}[language=C++]
#include <stdio>
void hello_world(void){
std::cout << "Hello World!" << std::endl;
}
\end{lstlisting}

Alternatively, one can use the syntax highlighting toolbox \href{https://pygments.org/}{\code{Pygments}} in combination with the \LaTeX-package \href{www.overleaf.com/learn/latex/Code\_Highlighting\_with\_minted}{\code{minted}}. It provides slightly better results, as the code will actually be parsed.

To install Pygments, use the following command. For \code{minted} to work properly, run the pdflatex tool with the flag \code{--shell-escape}. If you are using a TEX editor, you can modify the typesetting command somewhere in the settings.

\begin{lstlisting}[language=bash]
# Make sure that Pygments is installed.
python -m pip install pygments

# Then add the --shell-escape flag to the command
# that is used to compile your LaTeX code.
pdflatex --output-dir="$BUILD_DIR" \
--file-line-error \
--shell-escape \
--synctex=1 "$1"
\end{lstlisting}



% Set the following line to \iftrue if minted is available on your system.
% See the above instructions to see how.

\iffalse
See below how the result looks like if minted is available on your system.

\begin{listing}[!ht]
\inputminted[linenos, bgcolor=codebackground, style=friendly]{python}{Code/example.py}
\caption{Example from external file, parsed using \code{Pygments}}
\end{listing}

\fi
16 changes: 11 additions & 5 deletions Chapters/ChapterTemplate.tex
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
% Chapter Template
% Indicate the main file. Must go at the beginning of the file.
% !TEX root = ../main.tex

%----------------------------------------------------------------------------------------
% CHAPTER TEMPLATE
%----------------------------------------------------------------------------------------


\chapter{Chapter Title Here} % Main chapter title

\label{ChapterX} % Change X to a consecutive number; for referencing this chapter elsewhere, use \ref{ChapterX}

%----------------------------------------------------------------------------------------
% SECTION 1
% SECTION 1
%----------------------------------------------------------------------------------------

\section{Main Section 1}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam ultricies lacinia euismod. Nam tempus risus in dolor rhoncus in interdum enim tincidunt. Donec vel nunc neque. In condimentum ullamcorper quam non consequat. Fusce sagittis tempor feugiat. Fusce magna erat, molestie eu convallis ut, tempus sed arcu. Quisque molestie, ante a tincidunt ullamcorper, sapien enim dignissim lacus, in semper nibh erat lobortis purus. Integer dapibus ligula ac risus convallis pellentesque.

%-----------------------------------
% SUBSECTION 1
% SUBSECTION 1
%-----------------------------------
\subsection{Subsection 1}

Nunc posuere quam at lectus tristique eu ultrices augue venenatis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aliquam erat volutpat. Vivamus sodales tortor eget quam adipiscing in vulputate ante ullamcorper. Sed eros ante, lacinia et sollicitudin et, aliquam sit amet augue. In hac habitasse platea dictumst.

%-----------------------------------
% SUBSECTION 2
% SUBSECTION 2
%-----------------------------------

\subsection{Subsection 2}
Morbi rutrum odio eget arcu adipiscing sodales. Aenean et purus a est pulvinar pellentesque. Cras in elit neque, quis varius elit. Phasellus fringilla, nibh eu tempus venenatis, dolor elit posuere quam, quis adipiscing urna leo nec orci. Sed nec nulla auctor odio aliquet consequat. Ut nec nulla in ante ullamcorper aliquam at sed dolor. Phasellus fermentum magna in augue gravida cursus. Cras sed pretium lorem. Pellentesque eget ornare odio. Proin accumsan, massa viverra cursus pharetra, ipsum nisi lobortis velit, a malesuada dolor lorem eu neque.

%----------------------------------------------------------------------------------------
% SECTION 2
% SECTION 2
%----------------------------------------------------------------------------------------

\section{Main Section 2}
Expand Down
30 changes: 30 additions & 0 deletions Code/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import numpy as np

def compute_pi(n):
"""
Compute pi using Leibniz' formula:
1 - 1/3 + 1/5 - 1/7 + 1/9 - ... = pi/4
"""
k = 1 # Denominator
s = 0 # Sum

for i in range(n):
if i % 2 == 0:
s += 4/k
else:
# odd index elements are negative
s -= 4/k
k += 2

return s

def main():
n = 1000
pi = compute_pi(n)
pi_ref = np.pi
print("Pi (computed): %f (n=%d)" % (pi,n))
print("Pi (reference): %f" % pi_ref)
print("Difference: %f" % (pi_ref-pi))


main()
Binary file removed Figures/ZHAW_Logo.png
Binary file not shown.
Binary file added Figures/title-page.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Figures/zhaw_font_deu_font.pdf
Binary file not shown.
Binary file added Figures/zhaw_font_eng_font.pdf
Binary file not shown.
Binary file added Figures/zhaw_rgb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions Front/abstract.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
% !TEX root = ../main.tex

%----------------------------------------------------------------------------------------
% ABSTRACT PAGE
%----------------------------------------------------------------------------------------
\begin{abstract}
\addchaptertocentry{\abstractname} % Add the abstract to the table of contents
The abstract is like a miniature version of the entire manuscript. Structure it similarly: Begin with the context and motivation for the project, a brief description of the method and available data, your findings, and conclusions. Limit yourself to one page!
\end{abstract}


%----------------------------------------------------------------------------------------
% German ABSTRACT PAGE
%----------------------------------------------------------------------------------------
\begin{extraAbstract}
\addchaptertocentry{\extraabstractname} % Add the abstract to the table of contents

Die Zusammenfassung entspricht einer Miniaturversion des gesamten Dokuments. Gliedere sie ähnlich: Beginne mit dem Kontext und der Motivation für das Projekt, einer kurzen Beschreibung der Methode und der verfügbaren Daten, Ihren Ergebnissen und den Schlussfolgerungen. Beschränke dich auf eine Seite!
\end{extraAbstract}
10 changes: 10 additions & 0 deletions Front/acknowledgements.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
% !TEX root = ../main.tex

%----------------------------------------------------------------------------------------
% ACKNOWLEDGEMENTS
%----------------------------------------------------------------------------------------
\begin{acknowledgements}
\addchaptertocentry{\acknowledgementname} % Add the acknowledgements to the table of contents

The acknowledgements belong here. Do not forget to mention your project supervisors, without flattering them too much.
\end{acknowledgements}
32 changes: 32 additions & 0 deletions Front/declaration.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
% !TEX root = ../main.tex

%----------------------------------------------------------------------------------------
% DECLARATION OF ORIGINALITY
%----------------------------------------------------------------------------------------

\begin{declaration}
\addchaptertocentry{\authorshipname} % Add the declaration to the table of contents

\begin{textbox}{red}{2}
REMOVE THIS SECTION IF THE \href{https://www.zhaw.ch/en/lsfm/study/studiweb/master-ls/masters-thesis/}{ORIGINAL COPY OF THE ZHAW DECLARATION OF ORIGINALITY} IS USED IN THE APPENDIX.
\end{textbox}
\vspace{1cm}

\noindent I, \authorname, declare that this thesis titled, \enquote{\ttitle} and the work presented in it are my own. I confirm that:

\begin{itemize}
\item This work was done wholly or mainly while in candidature for a research degree at the \univname.
\item Where any part of this thesis has previously been submitted for a degree or any other qualification at this university or any other institution, this has been clearly stated.
\item Where I have consulted the published work of others, this is always clearly attributed.
\item Where I have quoted from the work of others, the source is always given. With the exception of such quotations, this thesis is entirely my own work.
\item I have acknowledged all main sources of help.
\item Where the thesis is based on work done by myself jointly with others, I have made clear exactly what was done by others and what I have contributed myself.\\
\end{itemize}
\vspace{1cm}

\noindent Signed:\\
\rule[0.5em]{25em}{0.5pt} % This prints a line for the signature

\noindent Date:\\
\rule[0.5em]{25em}{0.5pt} % This prints a line to write the date
\end{declaration}
Loading

0 comments on commit 912f982

Please sign in to comment.