Extract \usepackage to config/ files
This commit is contained in:
25
config/bibliography.tex
Normal file
25
config/bibliography.tex
Normal file
@@ -0,0 +1,25 @@
|
||||
\usepackage[
|
||||
backend=biber,
|
||||
style=authoryear,
|
||||
backref=true,% Show page numbers where citations appear
|
||||
maxbibnames=99,% Show all authors in bibliography
|
||||
maxcitenames=1,% Show only one author in citations
|
||||
uniquelist=false% Force maxcitenames
|
||||
]{biblatex}
|
||||
|
||||
\DefineBibliographyStrings{english}{andothers={}} % Remove "et al." in citations
|
||||
|
||||
% Use square brackets for citations
|
||||
\AtEveryCite{
|
||||
\let\bibopenparen=\bibopenbracket%
|
||||
\let\bibcloseparen=\bibclosebracket%
|
||||
}
|
||||
|
||||
% Remove some fields from bibliography
|
||||
\AtEveryBibitem{
|
||||
\clearfield{doi}%
|
||||
\clearfield{day}%
|
||||
\clearfield{location}%
|
||||
\clearfield{month}%
|
||||
\clearfield{series}%
|
||||
}
|
||||
37
config/content.tex
Normal file
37
config/content.tex
Normal file
@@ -0,0 +1,37 @@
|
||||
% Changes
|
||||
\usepackage[draft, defaultcolor=Blue, xcolor=dvipsnames]{changes} % Track changes
|
||||
\definechangesauthor[color=RawSienna]{CP}
|
||||
\newcommand{\CP}[1]{\comment[id=CP]{#1}}
|
||||
|
||||
% Images
|
||||
\usepackage{graphicx}
|
||||
\usepackage{caption} % Point references to the figure not the caption
|
||||
|
||||
% Includes
|
||||
\usepackage{import} % Allow relative paths
|
||||
\usepackage{pdfpages} % Include PDFs
|
||||
|
||||
% Lists
|
||||
\usepackage[inline]{enumitem} % Customise lists
|
||||
\setitemize{noitemsep} % No space between items in itemize
|
||||
|
||||
% References
|
||||
\usepackage{bookmark} % Manage bookmarks
|
||||
\usepackage{etoc} % Local table of contents
|
||||
|
||||
% Tables
|
||||
\usepackage{booktabs} % Better tables
|
||||
\usepackage{makecell} % For multi-line cells in tables
|
||||
\usepackage{multirow} % Multi-row cells in tables
|
||||
\usepackage{tabularx} % For tables with fixed width
|
||||
|
||||
% Units
|
||||
\usepackage{siunitx} % For numbers with units
|
||||
\sisetup{
|
||||
retain-explicit-plus=true, % Keep + in numbers
|
||||
uncertainty-mode=separate % Separate uncertainty with +- instead of ()
|
||||
}
|
||||
|
||||
% Others
|
||||
\usepackage[autostyle]{csquotes} % For quotes
|
||||
\usepackage[dvipsnames]{xcolor} % More colors
|
||||
22
config/template.tex
Normal file
22
config/template.tex
Normal file
@@ -0,0 +1,22 @@
|
||||
% Margins
|
||||
\usepackage[inner=35mm, outer=20mm, top=30mm, bottom=25mm]{geometry}
|
||||
|
||||
% Set line spacing to 1.15
|
||||
\usepackage{setspace}
|
||||
\linespread{1.15}
|
||||
|
||||
% Typography
|
||||
\usepackage{mathtools} % Math improvements
|
||||
\usepackage[T1]{fontenc} % Use T1 font encoding
|
||||
\usepackage[english]{babel} % Typographical rules
|
||||
\usepackage[varqu, varl]{inconsolata} % Better monospace font (with alternative "quote" [varqu] and "l" [varl])
|
||||
\usepackage{libertinus} % Libertinus font for text and math
|
||||
\usepackage{microtype} % Micro-typography improvements (slightly more compact, better to read)
|
||||
|
||||
% Use sans-serif font for sections
|
||||
\usepackage{sectsty}
|
||||
\chapterfont{\sffamily}
|
||||
\allsectionsfont{\sffamily}
|
||||
|
||||
% Headers
|
||||
\usepackage{emptypage} % Remove headers and footers on empty pages
|
||||
33
config/thesis_commands.tex
Normal file
33
config/thesis_commands.tex
Normal file
@@ -0,0 +1,33 @@
|
||||
\newcommand{\importchapter}[2]{% Load a chapter (#2) in a path (#1)
|
||||
\cleardoublepage% after a clear double page
|
||||
\graphicspath{{#1/figures/}}% with figures
|
||||
\includefrom{#1}{#2}% and relative paths \input in the chapter
|
||||
}
|
||||
|
||||
\newcommand{\chaptertoc}{% Print the table of contents for the chapter
|
||||
\vspace*{-1cm}%
|
||||
\horizontalrule%
|
||||
\vspace*{-0.5cm}%
|
||||
\localtableofcontents%
|
||||
\horizontalrule%
|
||||
}
|
||||
|
||||
% Add chapter label as prefix to all other sub-labels
|
||||
\NewCommandCopy{\oldlabel}{\label}
|
||||
\newcommand{\labelprefix}{main}
|
||||
\newcommand{\mainlabel}[1]{%
|
||||
\renewcommand{\labelprefix}{#1}%
|
||||
\oldlabel{\labelprefix}%
|
||||
}
|
||||
\renewcommand{\label}[1]{\oldlabel{\labelprefix:#1}}
|
||||
|
||||
% References
|
||||
\newcommand{\chapref}[1]{chapter~\ref{#1}}
|
||||
\newcommand{\Chapref}[1]{Chapter~\ref{#1}}
|
||||
\renewcommand{\eqref}[1]{Equation~\ref{\labelprefix:eq:#1}}
|
||||
\renewcommand{\figref}[1]{Figure~\ref{\labelprefix:fig:#1}}
|
||||
\newcommand{\partref}[1]{part~\ref{#1}}
|
||||
\newcommand{\Partref}[1]{Part~\ref{#1}}
|
||||
\renewcommand{\secref}[1]{section~\ref{\labelprefix:sec:#1}}
|
||||
\newcommand{\Secref}[1]{Section~\ref{\labelprefix:sec:#1}}
|
||||
\renewcommand{\tabref}[1]{Table~\ref{\labelprefix:tab:#1}}
|
||||
120
main.tex
120
main.tex
@@ -1,70 +1,12 @@
|
||||
% Template
|
||||
\documentclass[twoside, a4paper, 12pt]{book}
|
||||
\usepackage[inner=35mm, outer=20mm, top=30mm, bottom=25mm]{geometry}
|
||||
|
||||
\usepackage{setspace} % Set line spacing to 1.15
|
||||
\linespread{1.15}
|
||||
|
||||
\usepackage{sectsty} % Use sans-serif font for sections
|
||||
\chapterfont{\sffamily}
|
||||
\allsectionsfont{\sffamily}
|
||||
|
||||
% Typography
|
||||
\usepackage{mathtools} % Math improvements
|
||||
\usepackage[T1]{fontenc} % Use T1 font encoding
|
||||
\usepackage[english]{babel} % Typographical rules
|
||||
\usepackage[varqu, varl]{inconsolata} % Better monospace font (with alternative "quote" [varqu] and "l" [varl])
|
||||
\usepackage{libertinus} % Libertinus font for text and math
|
||||
\usepackage{microtype} % Micro-typography improvements (slightly more compact, better to read)
|
||||
\input{config/template}
|
||||
|
||||
% Bibliography
|
||||
\usepackage[
|
||||
backend=biber,
|
||||
style=authoryear,
|
||||
backref=true,% Show page numbers where citations appear
|
||||
maxbibnames=99,% Show all authors in bibliography
|
||||
maxcitenames=1,% Show only one author in citations
|
||||
uniquelist=false% Force maxcitenames
|
||||
]{biblatex}
|
||||
|
||||
\DefineBibliographyStrings{english}{andothers={}} % Remove "et al." in citations
|
||||
|
||||
\AtEveryCite{% Use square brackets for citations
|
||||
\let\bibopenparen=\bibopenbracket%
|
||||
\let\bibcloseparen=\bibclosebracket%
|
||||
}
|
||||
|
||||
\input{config/bibliography}
|
||||
\addbibresource{references.bib} % Load bibliography
|
||||
|
||||
\AtEveryBibitem{% Remove some fields from bibliography
|
||||
\clearfield{doi}%
|
||||
\clearfield{day}%
|
||||
\clearfield{location}%
|
||||
\clearfield{month}%
|
||||
\clearfield{series}%
|
||||
}
|
||||
|
||||
|
||||
% Changes
|
||||
\usepackage[draft, defaultcolor=Blue, xcolor=dvipsnames]{changes} % Track changes
|
||||
\definechangesauthor[color=RawSienna]{CP}
|
||||
\newcommand{\CP}[1]{\comment[id=CP]{#1}}
|
||||
|
||||
% Images
|
||||
\usepackage{graphicx}
|
||||
\usepackage{caption} % Point references to the figure not the caption
|
||||
|
||||
% Includes
|
||||
\usepackage{import} % Allow relative paths
|
||||
\usepackage{pdfpages} % Include PDFs
|
||||
|
||||
% Lists
|
||||
\usepackage[inline]{enumitem} % Customise lists
|
||||
\setitemize{noitemsep} % No space between items in itemize
|
||||
|
||||
% References
|
||||
\usepackage{bookmark} % Manage bookmarks
|
||||
\usepackage{etoc} % Local table of contents
|
||||
\usepackage{hyperref} % Hyperlinks
|
||||
\hypersetup{
|
||||
bookmarksnumbered = true, % Include section numbers in bookmarks
|
||||
@@ -75,64 +17,14 @@
|
||||
pdfkeywords = {},
|
||||
}
|
||||
|
||||
% Tables
|
||||
\usepackage{booktabs} % Better tables
|
||||
\usepackage{makecell} % For multi-line cells in tables
|
||||
\usepackage{multirow} % Multi-row cells in tables
|
||||
\usepackage{tabularx} % For tables with fixed width
|
||||
|
||||
% Units
|
||||
\usepackage{siunitx} % For numbers with units
|
||||
\sisetup{
|
||||
retain-explicit-plus=true, % Keep + in numbers
|
||||
uncertainty-mode=separate % Separate uncertainty with +- instead of ()
|
||||
}
|
||||
|
||||
% Others
|
||||
\usepackage[autostyle]{csquotes} % For quotes
|
||||
\usepackage{emptypage} % Remove headers and footers on empty pages
|
||||
\usepackage[dvipsnames]{xcolor} % More colors
|
||||
|
||||
% Content
|
||||
\input{config/content}
|
||||
|
||||
% Custom commands
|
||||
\input{utils/commands}
|
||||
\input{config/thesis_commands}
|
||||
|
||||
\newcommand{\importchapter}[2]{% Load a chapter (#2) in a path (#1)
|
||||
\cleardoublepage% after a clear double page
|
||||
\graphicspath{{#1/figures/}}% with figures
|
||||
\includefrom{#1}{#2}% and relative paths \input in the chapter
|
||||
}
|
||||
|
||||
\newcommand{\chaptertoc}{% Print the table of contents for the chapter
|
||||
\vspace*{-1cm}%
|
||||
\horizontalrule%
|
||||
\vspace*{-0.5cm}%
|
||||
\localtableofcontents%
|
||||
\horizontalrule%
|
||||
}
|
||||
|
||||
% Add chapter label as prefix to all other sub-labels
|
||||
\NewCommandCopy{\oldlabel}{\label}
|
||||
\newcommand{\labelprefix}{main}
|
||||
\newcommand{\mainlabel}[1]{%
|
||||
\renewcommand{\labelprefix}{#1}%
|
||||
\oldlabel{\labelprefix}%
|
||||
}
|
||||
\renewcommand{\label}[1]{\oldlabel{\labelprefix:#1}}
|
||||
|
||||
% References
|
||||
\newcommand{\chapref}[1]{chapter~\ref{#1}}
|
||||
\newcommand{\Chapref}[1]{Chapter~\ref{#1}}
|
||||
\renewcommand{\eqref}[1]{Equation~\ref{\labelprefix:eq:#1}}
|
||||
\renewcommand{\figref}[1]{Figure~\ref{\labelprefix:fig:#1}}
|
||||
\newcommand{\partref}[1]{part~\ref{#1}}
|
||||
\newcommand{\Partref}[1]{Part~\ref{#1}}
|
||||
\renewcommand{\secref}[1]{section~\ref{\labelprefix:sec:#1}}
|
||||
\newcommand{\Secref}[1]{Section~\ref{\labelprefix:sec:#1}}
|
||||
\renewcommand{\tabref}[1]{Table~\ref{\labelprefix:tab:#1}}
|
||||
|
||||
|
||||
%% Document
|
||||
% Document
|
||||
\begin{document}
|
||||
|
||||
\selectlanguage{english}
|
||||
|
||||
Reference in New Issue
Block a user