-
Notifications
You must be signed in to change notification settings - Fork 31
/
report.tex
161 lines (142 loc) · 4.94 KB
/
report.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
% #######################################
% ########### FILL THESE IN #############
% #######################################
\def\mytitle{Coursework Report}
\def\mykeywords{Fill, These, In, So, google, can, find, your, report}
\def\myauthor{Cool Student}
\def\contact{4008000@napier.ac.uk}
\def\mymodule{Module Title (SET00000)}
% #######################################
% #### YOU DON'T NEED TO TOUCH BELOW ####
% #######################################
\documentclass[10pt, a4paper]{article}
\usepackage[a4paper,outer=1.5cm,inner=1.5cm,top=1.75cm,bottom=1.5cm]{geometry}
\twocolumn
\usepackage{graphicx}
\graphicspath{{./images/}}
%colour our links, remove weird boxes
\usepackage[colorlinks,linkcolor={black},citecolor={blue!80!black},urlcolor={blue!80!black}]{hyperref}
%Stop indentation on new paragraphs
\usepackage[parfill]{parskip}
%% Arial-like font
\IfFileExists{uarial.sty}
{
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{uarial}
\renewcommand{\familydefault}{\sfdefault}
}{
\GenericError{}{Couldn't find Arial font}{ you may need to install 'nonfree' fonts on your system}{}
\usepackage{lmodern}
\renewcommand*\familydefault{\sfdefault}
}
%Napier logo top right
\usepackage{watermark}
%Lorem Ipusm dolor please don't leave any in you final report ;)
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{listings}
%give us the Capital H that we all know and love
\usepackage{float}
%tone down the line spacing after section titles
\usepackage{titlesec}
%Cool maths printing
\usepackage{amsmath}
%PseudoCode
\usepackage{algorithm2e}
\titlespacing{\subsection}{0pt}{\parskip}{-3pt}
\titlespacing{\subsubsection}{0pt}{\parskip}{-\parskip}
\titlespacing{\paragraph}{0pt}{\parskip}{\parskip}
\newcommand{\figuremacro}[5]{
\begin{figure}[#1]
\centering
\includegraphics[width=#5\columnwidth]{#2}
\caption[#3]{\textbf{#3}#4}
\label{fig:#2}
\end{figure}
}
\lstset{
escapeinside={/*@}{@*/}, language=C++,
basicstyle=\fontsize{8.5}{12}\selectfont,
numbers=left,numbersep=2pt,xleftmargin=2pt,frame=tb,
columns=fullflexible,showstringspaces=false,tabsize=4,
keepspaces=true,showtabs=false,showspaces=false,
backgroundcolor=\color{white}, morekeywords={inline,public,
class,private,protected,struct},captionpos=t,lineskip=-0.4em,
aboveskip=10pt, extendedchars=true, breaklines=true,
prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
keywordstyle=\color[rgb]{0,0,1},
commentstyle=\color[rgb]{0.133,0.545,0.133},
stringstyle=\color[rgb]{0.627,0.126,0.941}
}
\thiswatermark{\centering \put(336.5,-38.0){\includegraphics[scale=0.8]{logo}} }
\title{\mytitle}
\author{\myauthor\hspace{1em}\\\contact\\Edinburgh Napier University\hspace{0.5em}-\hspace{0.5em}\mymodule}
\date{}
\hypersetup{pdfauthor=\myauthor,pdftitle=\mytitle,pdfkeywords=\mykeywords}
\sloppy
% #######################################
% ########### START FROM HERE ###########
% #######################################
\begin{document}
\maketitle
\begin{abstract}
%Replace the lipsum command with actual text
\lipsum[2]
\end{abstract}
\textbf{Keywords -- }{\mykeywords}
\section{Introduction}
\paragraph{Referencing}
You should cite References like this: \cite{Keshav}. The references are saved in an external .bib file, and will automatically be added to the bibliography at the end once cited.
\figuremacro{h}{placeholder}{ImageTitle}{ - Some Descriptive Text}{1.0}
\section{Formatting}
Some common formatting you may need uses these commands for \textbf{Bold Text}, \textit{Italics}, and \underline{underlined}.
\subsection{LineBreaks}
Here is a line
Here is a line followed by a double line break.
This line is only one line break down from the above, Notice that latex can ignore this
We can force a break \\ with the break operator.
\subsection{Maths}
Embedding Maths is Latex's bread and butter
{\centering \Large \(
J = \begin{bmatrix}
\frac{\delta e}{\delta \theta _0}
\frac{\delta e}{\delta \theta _1}
\frac{\delta e}{\delta \theta _2}
\end{bmatrix}
= e_{current} - e_{target}
\)\par}
\subsection{Code Listing}
You can load segments of code from a file, or embed them directly.
\begin{lstlisting}[caption = Hello World! in c++]
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
std::cin.get();
return 0;
}
\end{lstlisting}
\lstinputlisting[caption = Hello World! in python script]{./sourceCode/hello.py}
\subsection{PseudoCode}
\begin{algorithm}[h]
\For{$i = 0$ \KwTo $100$}{
print\_number = true\;
\If{i is divisible by 3}{
print "Fizz"\;
print\_number = false\;
}
\If{i is divisible by 5}{
print "Buzz"\;
print\_number = false\;
}
\If{print\_number}{
print i\;
}
print a newline\;
}
\caption{FizzBuzz}
\end{algorithm}
\section{Conclusion}
\bibliographystyle{ieeetr}
\bibliography{references}
\end{document}