Thesis

Thesis LaTeX template.

Category

thesis

License

Free to use (MIT)

File

eng/main.tex

main.texRead-only preview
\documentclass[
12pt,               % Font size
a4paper,            % Paper size (a4 = 210x297 mm)
DIV=12,             % Ratio of text area to margins (higher = more text)
BCOR=13.7mm,        % Extra inner margin reserved for binding
headsepline,        % Horizontal rule below the page header
listof=totoc,       % Include lists of figures/tables in the table of contents
chapterprefix,      % Prefix chapter titles with the word "Chapter"
numbers=noenddot,   % No trailing dot after section numbers
bibliography=totoc  % Include the bibliography in the table of contents
]{scrbook}

% KOMA-Script page header/footer layout
\usepackage{scrlayer-scrpage}
% Patches minor incompatibilities between KOMA-Script and other packages
% listings=false: disables the listings patch (incompatible with TeX Live 2024)
\usepackage[listings=false]{scrhack}

%% Language
\usepackage[english]{babel}

%% Encoding and fonts
\usepackage[utf8]{inputenc}  % Source file encoding
\usepackage[T1]{fontenc}     % Output font encoding (correct hyphenation for accented chars)
\usepackage{lmodern}         % Latin Modern fonts (vector, replaces bitmap CM fonts)

%% Microtypography — better justification, fewer hyphenations, no configuration needed
\usepackage{microtype}

%% Line spacing
\usepackage{setspace}
\onehalfspacing  % Required by most university style guides

%% Mathematics
\usepackage{amsmath}  % Enhanced equation environments and math commands

%% Code listings — colour style is defined in packages/notation.sty
\usepackage{listings}
\usepackage{xcolor}
\input{packages/notation.sty}

%% Figures
\usepackage{graphicx}
\graphicspath{{figures/}}  % Default path for \includegraphics
\usepackage{caption}       % Customisable figure/table captions

%% Tables
\usepackage{booktabs}  % Professional-looking rules: \toprule, \midrule, \bottomrule

%% Hyperlinks and DOI support — always load last
% natbib: numbered citations | hyperref: clickable links | doi: DOI as hyperlink
\usepackage[numbers]{natbib}
\usepackage{hyperref,doi}

% =============================================================================
%% ── Thesis information — update these and nowhere else ──────────────────────
\newcommand{\thesistitle}{Bachelor's / Master's / PhD Thesis Title}
\newcommand{\thesisauthor}{Name Surname}
\newcommand{\thesissupervisor}{Prof. Name Surname}
\newcommand{\supervisorrole}{Supervisor}  % Change to Tutor, Director, PhD Supervisor, etc. as appropriate
\newcommand{\thesisdate}{Day Month Year}
\newcommand{\thesisdepartment}{Department Name / Doctoral Programme}
\newcommand{\thesisdegree}{Bachelor's/Master's Degree in ... / PhD in ...}
\newcommand{\thesistype}{Bachelor's / Master's / PhD Thesis}
\newcommand{\thesiscity}{Gijón}
\newcommand{\thekeywords}{keyword1, keyword2, keyword3}
%% ────────────────────────────────────────────────────────────────────────────

\hypersetup{
    colorlinks=true,
    linkcolor=black,  % Black: discreet; change to e.g. [rgb]{0,0,0.5} for dark blue
    urlcolor=blue,    % External URLs
    pdfencoding=auto, % Allows accented characters in PDF metadata
    pdftitle={\thesistitle},
    pdfauthor={\thesisauthor},
    pdfsubject={\supervisorrole: \thesissupervisor},
    pdfkeywords={\thekeywords},
}

%% Helper macro: blank page with no header (used in front matter files)
\newcommand{\blankpage}{\newpage\thispagestyle{empty}\mbox{}\newpage}

% =============================================================================
\begin{document}

\setcounter{secnumdepth}{3}  % Number sections down to \subsubsection
\setcounter{tocdepth}{2}     % Show sections down to \subsection in the ToC

% Page number in the outer header corner (inner = even pages, outer = odd pages)
\lohead{\bfseries\thepage}
\rehead{\bfseries\thepage}

% Front matter: roman page numbering, no chapter numbers (preface, ToC, etc.)
\frontmatter

\begin{center}
  \thispagestyle{empty}
  \includegraphics[height=6cm]{uniovi_logo.pdf}\\[0cm]  % Replace with your institution's logo
  {\large
  \thesisdepartment\\[0.2cm]\thesisdegree\\[1cm]

  \textbf{\MakeUppercase{\thesistitle}}
  \\[1.8cm]
  \thesistype\\[0.5cm]
  \textbf{\thesisauthor}
  \\[0.5cm]
  \supervisorrole\\[0.5cm]
  \textbf{\thesissupervisor}
  \\[1cm]
  \thesiscity, \thesisdate
  }
\end{center}

% Restore single spacing for the front matter pages (preface, abstracts)
\singlespacing

\input{content/00-APreface}
\input{content/00-BAbstract}
\input{content/00-CResumen}

% Restore one-and-a-half spacing for the rest of the document
\onehalfspacing

\cleardoublepage  % Table of contents starts on a right-hand page
\tableofcontents
\cleardoublepage  % Ensure each list starts on a right-hand page
\listoffigures    % Remove if the document contains no figures
\cleardoublepage
\listoftables     % Remove if the document contains no tables
\cleardoublepage
% \lstlistoflistings  % Uncomment to include a list of code listings

% Main matter: arabic page numbering restarts at 1, chapters are numbered
\mainmatter

\input{content/01-Introduction}
\input{content/02-StateOfArt}
\input{content/03-Methods}
\input{content/04-Experiments}
\input{content/05-Conclusions}
\appendix
\input{content/06-Appendix}

% scrbook does not rename the bibliography heading with babel; do it manually
\renewcommand{\bibname}{References}
\bibliographystyle{unsrtnat}
\bibliography{bibliography/references}

\end{document}
Preview
Thesis preview
Thesis LaTeX Template | Bibby | Bibby AI