UCD postgrad thesis template
Author
Fernando Almaguer-Angeles
Last Updated
2 years ago
License
LaTeX Project Public License 1.3c
Abstract
I did this thesis template while writing my master's thesis, in late 2019, hope it helps.
I did this thesis template while writing my master's thesis, in late 2019, hope it helps.
%https://sisweb.ucd.ie/usis/!W_HU_MENU.P_PUBLISH?p_tag=GD-DOCLAND&ID=122
\documentclass[11pt,oneside,openright,a4paper]{book}
\usepackage[a4paper,lmargin=30mm, textwidth=160mm, tmargin=20mm, textheight=257mm]{geometry} %https://www.overleaf.com/learn/latex/Page_size_and_margins
%One-and-a-half spacing shall be used, except for...
\usepackage[onehalfspacing]{setspace}
\usepackage[scaled]{helvet}
\renewcommand\familydefault{\sfdefault}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
%Footnotes shall not be less than 9pt
%https://tex.stackexchange.com/questions/322256/what-is-the-second-value-in-fontsize-for
\renewcommand{\footnotesize}{\fontsize{9pt}{11pt}\selectfont}
\usepackage[all]{nowidow}
\usepackage[english]{babel}
\usepackage[en-IE]{datetime2}
\DTMlangsetup[en-IE]{showdayofmonth=false}
\usepackage{graphicx,subfiles,tocbibind,amsmath,array,url,pdflscape}
%***************************************************
\usepackage[chapter]{algorithm}
\usepackage{algorithmic}
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
%***************************************************
\usepackage[bottom]{footmisc}
\usepackage[titletoc]{appendix}
\usepackage{hyperref}[backref]%\hyperref[appendix:test]{A} \href{https://www.algo.com}{here}
\hypersetup{
colorlinks = true,
allcolors = {blue},
linktocpage=true
}
\usepackage[longnamesfirst,sort&compress]{natbib}
\usepackage{bibentry}
\nobibliography*
\usepackage{lipsum,blindtext,multirow,rotating,dcolumn}%D{.}{.}{#1}
\usepackage[dvipsnames,table,xcdraw]{xcolor}%\textcolor{red}{text to put in red (like a note)}
\usepackage[space]{grffile}
\graphicspath{{images/}{../images/}}
%***************************************************
% correct bad hyphenation here
\hyphenation{op-ti-cal net-works semi-con-duc-tor}
%***************************************************
%\setlength{\parindent}{10ex} will be indented 10ex (an "ex" equals the lenght of the "x" in the current font)
\setlength{\parindent}{0pt}%no paragraph indent
\iffalse
\setlength{\parskip}{1em}%Paragraph spacing
\setlength{\baselineskip}{1.5em}%Line spacing
\fi
%***************************************************
%Page numbers shall be right justified at the bottom of the page.
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[R]{\thepage}
\renewcommand{\headrulewidth}{0pt}
}
%***************************************************
\DeclareUnicodeCharacter{2502}{\mbox{\kern.23em %│
\vrule height 2.2 ex depth 1 ex width .4 pt}}
\DeclareUnicodeCharacter{251C}{\mbox{\kern.23em %├
\vrule height 2.2 ex depth 1 ex width .4 pt \vrule height 2.2 pt depth -1.8 pt width .23em}}
\DeclareUnicodeCharacter{2500}{\mbox{ %─
\vrule height 2.2 pt depth -1.8 pt width .5em}}
\DeclareUnicodeCharacter{2514}{\mbox{\kern.23em %└
\vrule height 2.2 ex depth -1.8 pt width .4 pt \vrule height 2.2 pt depth -1.8 pt width .23em}}
%***************************************************
\usepackage{etoolbox}
\makeatletter
%... indented quotations and footnotes, where single spacing may be used.
\AtBeginEnvironment{quotation}{\singlespacing}
\AtBeginEnvironment{quote}{\singlespacing}
%\listoftables, \listofalgorithms, and \listoffigures chapter titles.
\newcommand{\thechaptername}{}
\newcounter{chapter@last@figure}
\newcounter{chapter@last@table}
\newcounter{chapter@last@algorithm}
\renewcommand{\chaptermark}[1]{
\markboth{#1}{}
\renewcommand{\thechaptername}{#1}
}
\pretocmd{\caption}{
\ifnum\pdfstrcmp{\@captype}{figure}=0
\ifnum\value{chapter}=\value{chapter@last@figure}
\else
\addtocontents{lof}
{\protect\numberline{\bfseries\thechapter\quad\thechaptername}}
\fi
\fi
\ifnum\pdfstrcmp{\@captype}{table}=0
\ifnum\value{chapter}=\value{chapter@last@table}
\else
\addtocontents{lot}
{\protect\numberline{\bfseries\thechapter\quad\thechaptername}}
\fi
\fi
\ifnum\pdfstrcmp{\@captype}{algorithm}=0
\ifnum\value{chapter}=\value{chapter@last@algorithm}
\else
\addtocontents{loa}
{\protect\numberline{\bfseries\thechapter\quad\thechaptername}}
\fi
\fi
\expandafter\setcounter\expandafter{chapter@last@\@captype}{\value{chapter}}
}{}{failure}
\makeatother
%***************************************************
\begin{document}
%To start a new paragraph, check chapter 2
\newcolumntype{d}[1]{D{.}{.}{#1}}%https://en.wikibooks.org/wiki/LaTeX/Tables#@-expressions
\frontmatter
\begin{singlespace}
\subfile{sections/front/title}
\tableofcontents
\begin{doublespace}
\subfile{sections/front/abstract}
\end{doublespace}
\subfile{sections/front/statement}
\subfile{sections/front/collaborations}
\subfile{sections/front/acknowledgements}
\subfile{sections/front/dedication}
\listoftables
\listoffigures
\listofalgorithms
\addcontentsline{toc}{chapter}{List of Algorithms}
\subfile{refs/publications}
\end{singlespace}
\mainmatter
\subfile{sections/main/intro}
\subfile{sections/main/bg_and_rw}
\subfile{sections/main/analysis_fw}
\subfile{sections/main/exp_det_results}
\subfile{sections/main/conclusions}
\begin{singlespace}
\clearpage
\noappendicestocpagenum
\addappheadtotoc
\appendixpage
\subfile{sections/appendices}
\bibliographystyle{plainnat}
\bibliography{refs/references}
\end{singlespace}
\end{document}