197 lines
5.1 KiB
TeX
197 lines
5.1 KiB
TeX
\NeedsTeXFormat{LaTeX2e}
|
|
\ProvidesPackage{ntnu-report}[]
|
|
|
|
\RequirePackage[dvipsnames]{xcolor}
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%
|
|
% IMAGES AND GRAPHICS %
|
|
%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
\RequirePackage{graphicx} % Handle images
|
|
\RequirePackage{wrapfig} % Wrap text around images
|
|
\RequirePackage{float} % Force image location using "H"
|
|
|
|
%%%%%%%%%%%%%%%%%%
|
|
% LANGUAGE/BABEL %
|
|
%%%%%%%%%%%%%%%%%%
|
|
|
|
\RequirePackage[utf8]{inputenc}
|
|
|
|
\renewcommand*\contentsname{Table of Contents} % Rename table of contents
|
|
\renewcommand{\listfigurename}{List of Figures} % Rename list of figures
|
|
\renewcommand{\listtablename}{List of Tables} % Rename list of tables
|
|
|
|
%%%%%%%%%%%%
|
|
% HYPERREF %
|
|
%%%%%%%%%%%%
|
|
|
|
\RequirePackage{hyperref} % Hyper-references, possible to change color
|
|
\hypersetup{ % Color of hyper-references
|
|
colorlinks,
|
|
citecolor=black,
|
|
filecolor=blue,
|
|
linkcolor=black,
|
|
urlcolor=blue
|
|
}
|
|
|
|
\RequirePackage{refcount}
|
|
\RequirePackage{url}
|
|
\RequirePackage{caption}
|
|
\RequirePackage{subcaption}
|
|
\RequirePackage[nottoc]{tocbibind} % Includes Bibliography, Index, list of Listing etc. to table of contents
|
|
\newcommand{\source}[1]{\vspace{-4pt} \caption*{\hfill \footnotesize{Source: {#1}} } } % Easily insert sources in images
|
|
\def\equationautorefname{Equation} % Autoref-name for equations
|
|
\def\figureautorefname{Figure} % Autoref-name for figures
|
|
\def\tableautorefname{Table} % Autoref-name for tables
|
|
\def\subsectionautorefname{\sectionautorefname} % Autoref-name for subsections
|
|
\def\subsubsectionautorefname{\sectionautorefname} % Autoref-name for subsubsections
|
|
|
|
%%%%%%%%%%%
|
|
% LENGTHS %
|
|
%%%%%%%%%%%
|
|
|
|
\RequirePackage[a4paper, total={150mm, 245mm,footskip = 14mm}]{geometry}
|
|
|
|
\RequirePackage{parskip}
|
|
\setlength{\parskip}{5mm}
|
|
\setlength{\parindent}{0mm}
|
|
|
|
\renewcommand{\baselinestretch}{1.5}
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
% TITLE, HEADER/FOOTER AND FRONTPAGE %
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
\RequirePackage{titling}
|
|
\RequirePackage{fancyhdr}
|
|
|
|
\pagestyle{fancy}
|
|
\fancyhf{}
|
|
\rhead{TDT4130 - Text Analysis Project}
|
|
\lhead{\thetitle}
|
|
\rfoot{Page \thepage}
|
|
|
|
\fancypagestyle{frontpage}{
|
|
\fancyhf{}
|
|
\rhead{}
|
|
\lhead{}
|
|
\rfoot{}
|
|
\renewcommand{\headrulewidth}{0pt}
|
|
}
|
|
|
|
%%%%%%%%%%%%%%%%%%%%
|
|
% SUBSUBSUBSECTION %
|
|
%%%%%%%%%%%%%%%%%%%%
|
|
|
|
% https://tex.stackexchange.com/questions/60209/how-to-add-an-extra-level-of-sections-with-headings-below-subsubsection
|
|
|
|
\RequirePackage{titlesec}
|
|
|
|
\titleclass{\subsubsubsection}{straight}[\subsection]
|
|
|
|
\newcounter{subsubsubsection}[subsubsection]
|
|
\renewcommand\thesubsubsubsection{\thesubsubsection.\arabic{subsubsubsection}}
|
|
\renewcommand\theparagraph{\thesubsubsubsection.\arabic{paragraph}} % optional; useful if paragraphs are to be numbered
|
|
|
|
\titleformat{\subsubsubsection}
|
|
{\normalfont\normalsize\bfseries}{\thesubsubsubsection}{1em}{}
|
|
\titlespacing*{\subsubsubsection}
|
|
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
|
|
|
|
\makeatletter
|
|
\renewcommand\paragraph{\@startsection{paragraph}{5}{\z@}%
|
|
{3.25ex \@plus1ex \@minus.2ex}%
|
|
{-1em}%
|
|
{\normalfont\normalsize\bfseries}}
|
|
\renewcommand\subparagraph{\@startsection{subparagraph}{6}{\parindent}%
|
|
{3.25ex \@plus1ex \@minus .2ex}%
|
|
{-1em}%
|
|
{\normalfont\normalsize\bfseries}}
|
|
\def\toclevel@subsubsubsection{4}
|
|
\def\toclevel@paragraph{5}
|
|
\def\toclevel@paragraph{6}
|
|
\def\l@subsubsubsection{\@dottedtocline{4}{7em}{4em}}
|
|
\def\l@paragraph{\@dottedtocline{5}{10em}{5em}}
|
|
\def\l@subparagraph{\@dottedtocline{6}{14em}{6em}}
|
|
\makeatother
|
|
|
|
\setcounter{secnumdepth}{4}
|
|
\setcounter{tocdepth}{4}
|
|
|
|
%%%%%%%%%%%%%%%%
|
|
% BIBLIOGRAPHY %
|
|
%%%%%%%%%%%%%%%%
|
|
|
|
\RequirePackage{csquotes}
|
|
\RequirePackage[
|
|
style=bath,
|
|
natbib=true,
|
|
backend=biber,
|
|
isbn=true,
|
|
url=true,
|
|
doi=true,
|
|
]{biblatex}
|
|
%\bibliographystyle{agsm}
|
|
|
|
% Removes date from online entries
|
|
\DeclareLabeldate[online]{%
|
|
\field{date}
|
|
\field{year}
|
|
\field{eventdate}
|
|
\field{origdate}
|
|
\field{urldate}
|
|
}
|
|
|
|
%\newcommand{\urlcite}[2]{\textit{#1} \citep{#2}}
|
|
\newcommand{\urlcite}[2]{\hyperlink{#2}{#1}}
|
|
|
|
% \newcommand{\appendixref}[2]{}
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%
|
|
% MISC CUSTOM COMMANDS %
|
|
%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
% \newcommand{\todo}[1]{}
|
|
\newcommand{\todo}[1]{ {\color{red}[TODO: #1]} }
|
|
\newcommand{\todocite}[1]{ {\color{Green}[CITE: #1]} }
|
|
\newcommand{\pageno}{ {\color{DarkOrchid}s.X} }
|
|
\newcommand{\?}{ {\color{red}(?)} }
|
|
|
|
% Needed to add appendices and stuff
|
|
\newcommand{\customphantomsection}[1]{
|
|
\cleardoublepage
|
|
\phantomsection
|
|
\setcounter{subsection}{0}
|
|
\setcounter{subsubsection}{0}
|
|
\addtocounter{section}{1}
|
|
\addcontentsline{toc}{section}{\protect\numberline{\thesection} #1}
|
|
}
|
|
|
|
\newcommand{\customphantomsubsection}[1]{
|
|
\cleardoublepage
|
|
\phantomsection
|
|
\addtocounter{subsection}{1}
|
|
\setcounter{subsubsection}{0}
|
|
\addcontentsline{toc}{subsection}{\protect\numberline{\thesubsection} #1}
|
|
}
|
|
|
|
%%%%%%%%%%
|
|
% TABLES %
|
|
%%%%%%%%%%
|
|
|
|
\RequirePackage{longtable}
|
|
\RequirePackage{booktabs}
|
|
\RequirePackage{tabu}
|
|
|
|
%%%%%%%%%%%%%%%%%
|
|
% MISCELLANEOUS %
|
|
%%%%%%%%%%%%%%%%%
|
|
|
|
\RequirePackage{import}
|
|
\RequirePackage{enumitem}
|
|
\RequirePackage{tikz}
|
|
\RequirePackage{csvsimple}
|
|
\RequirePackage{subcaption}
|
|
\RequirePackage[export]{adjustbox}
|
|
\RequirePackage[final]{pdfpages}
|