Report Template
Auteur
Mazen Amria
Last Updated
il y a 2 ans
License
Creative Commons CC BY 4.0
Résumé
This template has been prepared to be used for college assignments and reports.
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{float}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{multirow}
\usepackage{setspace}
\usepackage{parskip}
\usepackage{svg}
\usepackage[bottom]{footmisc}
\usepackage{tikz}
\usepackage[section]{placeins}
% This style is used to create block diagrams, you'll find it useful since many of your figures would be of that form, I'll try add more styles in the future :)
\usetikzlibrary{trees,positioning,fit,calc}
\tikzset{block/.style = {draw, fill=blue!20, rectangle,
minimum height=3em, minimum width=4em},
input/.style = {coordinate},
output/.style = {coordinate}
}
\usepackage[section]{minted}
\usepackage{xcolor}
\usemintedstyle{porland}
\usepackage{chngcntr}
\counterwithin{figure}{section}
\renewcommand{\arraystretch}{1.5}
\usepackage[hidelinks]{hyperref}
\hypersetup{
linktoc=all
}
\renewcommand\listingscaption{Listing}
\renewcommand\listoflistingscaption{List of Listings}
\usepackage{scrhack}
\usepackage{tocbasic}
\setuptoc{lol}{levelup}
\usepackage{indentfirst}
\geometry{a4paper, margin=1in}
%----------EDIT COVER INFO HERE -----------------%
\def \LOGOPATH {assets/birzeit-logo.svg}
\def \DEPARTEMENT {Department of Electrical \& Computer Engineering}
\def \COURSENUM {ENCS101}
\def \COURSENAME {Course Name}
\def \REPORTTITLE {Report Title}
\def \STUDENTNAME {Student's Name}
\def \STUDENTID {STUDNUM}
\def \INSTRUCTOR {Instructor's Name}
%------------------------------------------------%
\setlength{\parindent}{0em}
\setlength{\parskip}{0em}
\begin{document}
\pagenumbering{Roman}
\begin{titlepage}
\vfill
\begin{center}
\includesvg[width=0.7\textwidth]{\LOGOPATH} \\
\hfill \\
\Large{\DEPARTEMENT} \\
\Large{\COURSENUM\;-\;\COURSENAME} \\
\vfill
\textbf{\LARGE{\REPORTTITLE}}
\end{center}
\vfill
\begin{flushleft}
\Large{\textbf{Prepared by:} \STUDENTNAME} \\
\Large{\textbf{Instructor:} \INSTRUCTOR} \\
\Large{\textbf{Date:} \today}
\end{flushleft}
\vfill
\end{titlepage}
%--------------ABSTRACT ------------------------%
{
\centering
\section*{Abstract}
You can check the \mintinline{text}{cites.bib} in order to add references (it would be automatically added to the report once you cite it\cite{rfc3447} with \mintinline{latex}{\cite{tag}}). For the figures I do not prefer static figures, I like to generate them with TikZ, but in case you've needed some static figures you can add them to the \mintinline{text}{assets} directory to keep your files organized.
\clearpage
}
%-----------------------------------------------%
\tableofcontents
\clearpage
\setlength{\parskip}{\baselineskip}%
\pagenumbering{arabic}
%--------------INTRODUCTION ---------------------%
\section{Section}
\subsection{Tables}
Tables can be built and labeled like this, adding a new row requires adding new line of entries, separated by \mintinline{latex}{&} and ends with \mintinline{latex}{\\}, while adding new column requires adding \mintinline{latex}{l} in the \mintinline[escapeinside=!!]{latex}{\!!begin{tabular}{llll}} part.
\begin{table}[H]
\centering
\caption{Table Caption}
\begin{tabular}{llll}
\toprule
\textbf{Title 1} & \textbf{Title 2} & \textbf{Title 3} & \textbf{Title 4} \\
\midrule
Entry 1 & Entry 2 & Entry 3 & Entry 4 \\
Entry 5 & Entry 6 & Entry 7 & Entry 8 \\
\bottomrule
\end{tabular}
\label{tab:table_label}
\end{table}
\subsection{Figures}
you can add figures with captions, also you may label them and reference them again with \mintinline{latex}{\ref{fig:fig1}}.
\begin{figure}[H]
\centering
\includegraphics[width=0.5\textwidth]{assets/birzeit-logo.png}
\caption{Birzeit Logo (PNG)}
\label{fig:logo}
\end{figure}
\begin{figure}[H]
\centering
\includesvg[width=0.5\textwidth]{assets/birzeit-logo.svg}
\caption{Birzeit Logo (SVG)}
\end{figure}
Or you can generate figures using TikZ, I've provided some styles to generate block diagrams as in Figure \ref{fig:arch_comp}, but I won't be able to explain TikZ syntax for you so please try figure it out by yourself (it isn't hard to understand). Also you can add subfigures using \mintinline{latex}{subfigure} environment\footnote{Environment means a block surrounded by \mintinline[escapeinside=!!]{latex}{\!!begin{envname}} and \mintinline[escapeinside=!!]{latex}{\!!end{envname}}}.
\begin{figure}[!htb]
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
\begin{tikzpicture}
\node[input] (mi) {};
\node[block,right=of mi] (a) {$\mathrm{E}\left(p_k, \cdot\right)$};
\node[block,right=of a] (b) {$\mathrm{D}\left(s_k, \cdot\right)$};
\node[input,below=of a] (pk) {};
\node[input,below=of b] (sk) {};
\node[output, right=of b] (mo) {};
\draw[draw,->] (mi) -- node[above] {$m$} (a);
\draw[draw,->] (pk) -- node[left] {$p_k$} (a);
\draw[draw,->] (a) -- node[above] {$c$} (b);
\draw[draw,->] (sk) -- node[left] {$s_k$} (b);
\draw[draw,->] (b) -- node[above] {$m$} (mo);
\end{tikzpicture}
\caption{Public-Key Architecture}
\label{fig:pkcs_arch}
\end{subfigure}
\begin{subfigure}[b]{0.45\textwidth}
\centering
\begin{tikzpicture}
\node[input] (mi) {};
\node[block,right=of mi] (a) {$\mathrm{E}\left(k, \cdot\right)$};
\node[block,right=of a] (b) {$\mathrm{D}\left(k, \cdot\right)$};
\node[input,below=of a] (pk) {};
\node[input,below=of b] (sk) {};
\node[output, right=of b] (mo) {};
\draw[draw,->] (mi) -- node[above] {$m$} (a);
\draw[draw,->] (pk) -- node[left] {$k$} (a);
\draw[draw,->] (a) -- node[above] {$c$} (b);
\draw[draw,->] (sk) -- node[left] {$k$} (b);
\draw[draw,->] (b) -- node[above] {$m$} (mo);
\end{tikzpicture}
\caption{Symmetric-Key Architecture}
\label{fig:skcs_arch}
\end{subfigure}
\caption{Public-Key vs. Symmetric-Key: Architecture}
\label{fig:arch_comp}
\end{figure}
\subsection{Equations}
you can use \mintinline{latex}{align} environment to insert aligned equations like this
\begin{align}
& \tau = 28\;s \\
& \omega = 2 \pi \frac{2}{60} = 0.209\;rad/s \\
& \begin{aligned}[t]
lag &= \frac{\theta (\omega)}{\omega} = \frac{\arctan (\omega \tau)}{\omega} \\
&= \frac{\arctan (0.209 \cdot 28)}{0.209} \\
&= 6.69\;s
\end{aligned}
\end{align}
or you can insert \mintinline{latex}{\notag} at the end of each line to prevent it from being enumerated.
\begin{align}
& \tau = 28\;s \notag\\
& \omega = 2 \pi \frac{2}{60} = 0.209\;rad/s \notag\\
& \begin{aligned}[t]
lag &= \frac{\theta (\omega)}{\omega} = \frac{\arctan (\omega \tau)}{\omega} \\
&= \frac{\arctan (0.209 \cdot 28)}{0.209} \\
&= 6.69\;s
\end{aligned} \notag
\end{align}
And you can insert one line equation with \mintinline{latex}{equation} environment.
\begin{equation}
A = 15 \cdot B
\end{equation}
and \mintinline{latex}{equation*} environment to prevent the equation from being enumerated.
\begin{equation*}
A = 15 \cdot B
\end{equation*}
And inline math if you want with \mintinline{latex}{$Expression$} like this $A = 15$.
\subsection{Listings}
Listing \ref{lst:sample_C} shows a sample listing for C++ code.
\begin{listing}[H]
\begin{minted}[frame=single,framesep=10pt,breaklines,breakanywhere]{C++}
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n; cin >> n;
int a[n];
for (int i = 0; i < n; ++i)
cin >> a[i];
sort(a, a + n);
for (int i = 0; i < n; ++i)
cout << a[i];
return 0;
}
\end{minted}
\caption{Sample Code}
\label{lst:sample_C}
\end{listing}
Listing \ref{lst:sample_plain} shows a sample listing for shell session.
\begin{listing}[H]
\begin{minted}[frame=single,framesep=10pt,breaklines,breakanywhere]{shell}
$ g++ main.cpp
$ ./a.out
4
3 2 4 1
1 2 3 4
\end{minted}
\caption{Sample Output}
\label{lst:sample_plain}
\end{listing}
\clearpage
\section{Conclusion}
Feel free to use this template for your reports.
\clearpage
\bibliographystyle{IEEEtran}
\bibliography{IEEEabrv,cites}
\clearpage
\listoffigures
\clearpage
\listoftables
\clearpage
\listoflistings
\end{document}