%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Template for lab reports used at BIT modified from STIMA
%%% Author: Charlie Li
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Sets the document class for the document
% Openany is added to remove the book style of starting every new chapter on an odd page (not needed for reports)
\documentclass[12pt,english,openany,a4paper]{book}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Loading packages that alter the style
\usepackage[]{graphicx}
\usepackage[]{color}
\usepackage{alltt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
% Math
\usepackage{amsmath}
\usepackage{amssymb}
% Fonts
\renewcommand{\rmdefault}{ptm}
\renewcommand{\sfdefault}{phv}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\setlength{\parskip}{\smallskipamount}
\setlength{\parindent}{12pt}
\usepackage{indentfirst}
% Set page margins
\usepackage[top=80pt,bottom=60pt,left=78pt,right=78pt]{geometry}
\usepackage{subcaption}
% Package used for placeholder text
\usepackage{lipsum}
\usepackage{booktabs}
\usepackage{multirow}
% Prevents LaTeX from filling out a page to the bottom
\raggedbottom
% Adding both languages
\usepackage[english]{babel}
% All page numbers positioned at the bottom of the page
\usepackage{fancyhdr}
\fancyhf{} % clear all header and footers
\fancyfoot[C]{\thepage}
%\fancyhead[L]{{\selectfont \leftmark}}
\renewcommand{\headrulewidth}{0pt} % remove the header rule
\pagestyle{fancy}
% Changes the style of chapter headings
\usepackage{titlesec}
\titleformat{\chapter}
{\normalfont\LARGE\bfseries}{\thechapter.}{1em}{}
% Change distance between chapter header and text
\titlespacing{\chapter}{0pt}{40pt}{2\baselineskip}
% Adds table captions above the table per default
\usepackage{float}
\floatstyle{plaintop}
\restylefloat{table}
% Adds space between caption and table
\usepackage[tableposition=top]{caption}
% add cc license
\usepackage[
type={CC},
modifier={by-nc-sa},
version={4.0},
]{doclicense}
% Adds hyperlinks to references and ToC
\usepackage[backref=page]{hyperref} % hyperlinks
\renewcommand*{\backref}[1]{}
\renewcommand*{\backrefalt}[4]{{\footnotesize [%
\ifcase #1 Not cited.%
\or Cited on page~#2%
\else Cited on pages #2%
\fi%
]}}
\usepackage[capitalise]{cleveref}
% Uncomment the line below this block to set all hyperlink color to black
\hypersetup{
colorlinks,
linkcolor={blue},
citecolor={green!90!black},
urlcolor={red!70!black}
}
%\hypersetup{hidelinks,linkcolor = black} % Changes the link color to black and hides the hideous red border that usually is created
% Set specific color for hyperref
\usepackage{xcolor}
% tcolorbox; Notice! add "-shell-escape" to the compile command
\usepackage{tcolorbox}
% If multiple images are to be added, a folder (path) with all the images can be added here
\graphicspath{ {Figures/} }
% Separates the first part of the report/thesis in Roman numerals
\frontmatter
\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}{}
% Uncomment to stop the new chapter start at a new page
%\usepackage{etoolbox}
%\makeatletter
%\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
%\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Starts the document
\begin{document}
%%% Selects the language to be used for the first couple of pages
\selectlanguage{english}
%%%%% Adds the title page
\begin{titlepage}
\clearpage\thispagestyle{empty}
\centering
\vspace{1cm}
% Titles
% Information about the University
{\
\textsc{Course Name}
}
\vspace{2.5cm}
\rule{\linewidth}{2mm} \\[0.8cm]
{ \LARGE \sc The title of project:
A really cool project}\\[0.55cm]
\rule{\linewidth}{0.6mm} \\[3.4cm]
\hspace{2cm}
\begin{tabular}{l p{5cm}}
\textbf{Name} & James Bond \\[10pt]
\textbf{Student No.} & \texttt{1120202020} \\[10pt]
\textbf{Class} & \texttt{0000000} \\[10pt]
\textbf{Department} & School of Automation \\[10pt]
\textbf{Email} & \texttt{example@bit.edu.cn} \\[10pt]
\textbf{Date} & \today \\
\end{tabular}
\vfill
% Light logo and Dark logo
\centering \includegraphics[width=4.5cm]{bit_logo.pdf}\\ % light logo
%\centering \includegraphics[width=4.5cm]{logo_01}\\ % dark logo
\centering \includegraphics[width=4.5cm]{logo_slogan.pdf}
\vspace{0.5cm}
\pagebreak
\end{titlepage}
%% Uncomment for title page print two pages per sheet
%\shipout\null
% Comment the following two lines to remove abstract
\chapter*{\makebox[\linewidth]{Abstract}}
\addcontentsline{toc}{chapter}{Abstract}
This is a template for Projects/Report/Proposals at BIT. ~\lipsum[5]
\vspace{0.5cm}
\noindent\textbf{Keywords}:
\LaTeX, BIT
\clearpage
% Adds a table of contents keep the link black
\let\cleardoublepage\clearpage
{\hypersetup{linkcolor=black}
% or \hypersetup{linkcolor=black}, if the colorlinks=true option of hyperref is used
\tableofcontents{}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Text body starts here!
\mainmatter
\chapter{Problem Statement}\label{chapt:problem}
\lipsum[1-2]
\section{Requirements}
There are two logos to choose, shown in \cref{fig:logo1,fig:logo2}.
\begin{figure}[ht]
\centering
\begin{minipage}[c]{0.4\linewidth}
\includegraphics[width=0.9\linewidth]{Figures/bit_logo.pdf}
\caption{Lighter logo}
\label{fig:logo1}
\end{minipage}
\hspace{1.4cm}
\begin{minipage}[c]{0.4\linewidth}
\includegraphics[width=0.9\linewidth]{Figures/logo_01.pdf}
\caption{Darker logo}
\label{fig:logo2}
\end{minipage}%
\end{figure}
The template is designed for customization, in \texttt{"Figures/"} folder, \texttt{"bit\_logo.pdf"} is the left figure and \texttt{"logo\_01.pdf"} is the right figure.
\chapter{Introduction}\label{chapt:intro}
\LaTeX~is awesome. \lipsum[1]
\vspace{0.6cm}
\begin{tcolorbox}[title=\textbf{tcolorbox example}]
\lipsum[2]
\end{tcolorbox}
\chapter{Part Two}
Citation is used like\cite{ex}.
\begin{table}[b]
\centering
\begin{tabular}{lccc}
\toprule
\multirow{2}{*}{Model} & \multicolumn{3}{c}{Data} \\ \cmidrule(lr){2-4}
& Training Set & Test Set & Accuracy \\
\midrule
SVM & 300 & 200 & 84.00\% \\
C4.5 & 300 & 200 & 77.52\% \\
\bottomrule
\end{tabular}
\caption{The Comparision of Modeling Results}
\label{tab-label-2}
\end{table}
\begin{figure}[h]
\centering
\begin{subfigure}{0.49\linewidth} \centering
\includegraphics[scale=0.7]{Figures/fig1}
\caption{Example figure 1}\label{fig:figA}
\end{subfigure}
\begin{subfigure}{0.49\linewidth} \centering
\includegraphics[scale=0.7]{Figures/fig2}
\caption{Example figure 2}\label{fig:figB}
\end{subfigure}
\caption{Two figures side by side example 2} \label{fig:twodisturb}
\end{figure}
\cref{fig:figA,fig:figB} is an example of two figures side by side.
\begin{table}[h]
\centering
\begin{tabular}{lcccc}
\toprule
& \multicolumn{4}{c}{Data} \\ \cmidrule(lr){2-5}
DoS Types & Correct & Wrong & Total & Accuracy \\
\midrule
back & 0 & 359 & 359 & 0.00\% \\
land & 7 & 0 & 7 & 100.00\% \\
neptune & 4616 & 41 & 4657 & 99.12\% \\
pod & 36 & 5 & 41 & 87.80\% \\
smurf & 652 & 13 & 665 & 98.05\% \\
teardrop & 12 & 0 & 12 & 100\% \\
mailbomb & 0 & 293 & 293 & 0.00\% \\
apache2 & 72 & 665 & 737 & 9.77\% \\
processtable & 135 & 550 & 685 & 19.71\% \\
udpstorm & 0 & 2 & 2 & 0.00\% \\
\bottomrule
\end{tabular}
\caption{The Model1 for DoS Attack}
\label{tab-label}
\end{table}
\lipsum[6-9]
\chapter{Conclusions}
\lipsum[2]
\begin{figure}[h]
\centering
\includegraphics[width=0.6\linewidth]{Figures/logo_slogan}
\caption{Our school logo}
\label{fig:logoslogan}
\end{figure}
\lipsum[3-5]
\pagebreak
% Adding a bibliography if citations are used in the report
% Un/Comment the following line to customize the Bibliography title
\renewcommand{\bibname}{References}
\bibliographystyle{plain}
\bibliography{ref}
% Uncomment the following two lines to remvoe the cc license
\vspace*{\fill}
{\hypersetup{urlcolor=black}{\scriptsize \doclicenseThis}}
% Adds reference to the Bibliography in the ToC
\addcontentsline{toc}{chapter}{\bibname}
\pagebreak
\chapter*{Appendix}
\addcontentsline{toc}{chapter}{Appendix}
[\textit{Report the config files of the software used (i.e. SU2 and the mesher). Also attach to this report an archive with the mesh files, solutions and the reference solution data (e.g. data points of a Cp plot ...)}]
%\section*{Mesh configuration files}
%\section*{SU2 configuration files}
%% \section{Reference solution data}
\end{document}