-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
945 additions
and
630 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
Oops, something went wrong.