diff --git a/config.tex b/config.tex index 054e342..757a981 100644 --- a/config.tex +++ b/config.tex @@ -1,10 +1,11 @@ -% Units -\usepackage{siunitx} +\usepackage[french,english]{babel} -% Tables -\usepackage{booktabs} % Also used for glossaries +\usepackage{graphicx} +\graphicspath{{figs/}} + +\usepackage{subcaption} +\captionsetup{subrefformat=parens} -% Glossary and Acronyms \usepackage[ % acronym, % Separate acronyms and glossary toc, % appear in ToC @@ -13,6 +14,160 @@ nogroupskip, % don't group by letter nopostdot % don't add a dot at the end of each element ]{glossaries} + \usepackage[stylemods=longextra]{glossaries-extra} + \setabbreviationstyle[acronym]{long-short} \setglossarystyle{long-name-desc} + +\usepackage[olditem,oldenum]{paralist} + +\RequirePackage{setspace} +\onehalfspacing + +\usepackage{booktabs} +\usepackage{multirow} + +\usepackage[binary-units=true]{siunitx} + +\sisetup{% + detect-all = true, + detect-family = true, + detect-mode = true, + detect-shape = true, + detect-weight = true, + detect-inline-weight = math, +} + +\DeclareSIUnit\px{px} +\DeclareSIUnit\rms{rms} + +\usepackage{amsmath} +\usepackage{amsthm} +\usepackage{dsfont} + +\let\originalleft\left +\let\originalright\right +\renewcommand{\left}{\mathopen{}\mathclose\bgroup\originalleft} +\renewcommand{\right}{\aftergroup\egroup\originalright} + +\clubpenalty = 10000 +\widowpenalty = 10000 +\displaywidowpenalty = 10000 + +\usepackage{scrlayer-scrpage} + +\pagestyle{scrheadings} + +\renewcommand{\partformat}{\huge\partname~\thepart\autodot} +\renewcommand{\raggedpart}{\flushleft} + +\setkomafont{part}{\normalfont\huge\scshape} + +\setkomafont{sectioning}{\normalfont\scshape} +\setkomafont{descriptionlabel}{\normalfont\bfseries} + +\setkomafont{caption}{\small} +\setkomafont{captionlabel}{\usekomafont{caption}} + + +% Large number for chapter +\renewcommand*{\chapterformat}{% + \fontsize{50}{55}\selectfont\thechapter\autodot\enskip +} + +\makeatletter +\renewcommand*{\chapterformat}{ \mbox{\chapappifchapterprefix{\nobreakspace}{\color{BrickRed}\fontsize{40}{45}\selectfont\thechapter}\autodot\enskip}} +\renewcommand\@seccntformat[1]{\color{BrickRed} {\csname the#1\endcsname}\hspace{0.3em}} +\makeatother + +\renewcommand{\floatpagefraction}{.8}% + +\usepackage{etoolbox} + +\usepackage[ % + colorlinks=true, % + citecolor=BrickRed, % + linkcolor=BrickRed, % + urlcolor=BrickRed, % + unicode % + ]{hyperref} + +\usepackage{bookmark} + +\bookmarksetup{depth=2} + +\usepackage[ % use biblatex for bibliography + backend=biber, % use biber backend (bibtex replacement) or bibtex + style=ieee, % bib style + hyperref=true, % activate hyperref support + backref=true, % activate backrefs + isbn=false, % don't show isbn tags + url=false, % don't show url tags + doi=false, % don't show doi tags + urldate=long, % display type for dates + maxnames=3, % + minnames=1, % + maxbibnames=5, % + minbibnames=3, % + maxcitenames=2, % + mincitenames=1 % + ]{biblatex} + +\addbibresource{ref.bib} + +\AtEveryBibitem{% + \clearfield{urlyear} + \clearfield{urlmonth} + \clearfield{note} + \clearfield{issn} % Remove issn + \clearfield{doi} % Remove doi +\ifentrytype{online}{}{% Remove url except for @online + \clearfield{url} +} +} + +\setlength\bibitemsep{1.1\itemsep} + +\renewcommand*{\bibfont}{\footnotesize} + +\usepackage[sf, scaled=0.9]{quattrocento} + +\usepackage{crimson} + +\usepackage[oldstyle, scale=0.7]{sourcecodepro} + +\usepackage[usenames,dvipsnames]{xcolor} + +\usepackage{csquotes} + +\def\signed #1{{\leavevmode\unskip\nobreak\hfil\penalty50\hskip1em + \hbox{}\nobreak\hfill #1% + \parfillskip=0pt \finalhyphendemerits=0 \endgraf}} + +\newsavebox\mybox +\newenvironment{aquote}[1] +{\savebox\mybox{#1}\begin{quote}\openautoquote\hspace*{-.7ex}} + {\unskip\closeautoquote\vspace*{1mm}\signed{\usebox\mybox}\end{quote}} + +\usepackage{setspace} +\setstretch{1.25} + +\setparsizes{0em}{0.1\baselineskip plus .1\baselineskip}{1em plus 1fil} + +\usepackage{floatrow} +\floatsetup[table]{font={footnotesize,sf},capposition=top} + +\numberwithin{equation}{chapter} + +\usepackage{listings} +\usepackage{minted} +\setminted{autogobble=true,fontsize=\small,baselinestretch=0.8} +\setminted[python]{python3=true,tabsize=4} +\usemintedstyle{trac} +\lstset{abovecaptionskip=0} +\renewcommand{\listingscaption}{Code Snippet} + +\AtEndEnvironment{listing}{\vspace{-16pt}} + +\usepackage{scrhack} diff --git a/config_extra.tex b/config_extra.tex index 4f5d061..a13771b 100644 --- a/config_extra.tex +++ b/config_extra.tex @@ -1,21 +1,2 @@ -% Bibliography -\usepackage[ % use biblatex for bibliography - backend=biber, % use biber backend (bibtex replacement) or bibtex - style=ieee, % bib style - hyperref=true, % activate hyperref support - backref=true, % activate backrefs - isbn=false, % don't show isbn tags - url=false, % don't show url tags - doi=false, % don't show doi tags - urldate=long, % display type for dates - maxnames=3, % - minnames=1, % - maxbibnames=5, % - minbibnames=3, % - maxcitenames=2, % - mincitenames=1 % -]{biblatex} -\addbibresource{ref.bib} - -% Glossary -\makeglossaries{} +\makeindex +\makeglossaries diff --git a/phd-thesis.org b/phd-thesis.org index 589dd26..7c92d4e 100644 --- a/phd-thesis.org +++ b/phd-thesis.org @@ -8,7 +8,7 @@ #+DATE: {{{time(%Y-%m-%d)}}} #+LATEX_CLASS: scrreprt -#+LATEX_CLASS_OPTIONS: [a4paper, DIV=14, onecolumn, bibliography=totoc, twoside, openright] +#+LATEX_CLASS_OPTIONS: [a4paper, twoside, 11pt, onecolumn, bibliography=totoc, openright] #+BIND: org-latex-bib-compiler "biber" @@ -16,7 +16,7 @@ #+LATEX_HEADER_EXTRA: \input{config_extra.tex} :END: -* Build :noexport: +* Build :noexport: #+NAME: startblock #+BEGIN_SRC emacs-lisp :results none (add-to-list 'org-latex-classes @@ -60,12 +60,23 @@ | nass | NASS | Nano Active Stabilization System | | lti | LTI | Linear Time Invariant | +* TODO Title Page :noexport: * Test ** Test - acronyms ac:mimo, ac:siso, and again ac:mimo - glossary terms gls:ka, gls:phi. - Bibliography citations: cite:dehaeze21_activ_dampin_rotat_platf_using,dehaeze18_sampl_stabil_for_tomog_exper +** blabla +*** sdlfk + +*** sldkjf asdf +**** lksdfjasd +**** lksdfjasd +**** lksdfjasd +** blabla +* Test + * Bibliography :ignore: #+latex: \printbibliography diff --git a/phd-thesis.pdf b/phd-thesis.pdf index 8cffcc0..90b3708 100644 Binary files a/phd-thesis.pdf and b/phd-thesis.pdf differ diff --git a/phd-thesis.tex b/phd-thesis.tex index 0851561..675fef4 100644 --- a/phd-thesis.tex +++ b/phd-thesis.tex @@ -1,6 +1,6 @@ -% Created 2021-05-19 mer. 17:31 +% Created 2021-05-19 mer. 19:03 % Intended LaTeX compiler: pdflatex -\documentclass[a4paper, DIV=14, onecolumn, bibliography=totoc, twoside, openright]{scrreprt} +\documentclass[a4paper, twoside, 11pt, onecolumn, bibliography=totoc, openright]{scrreprt} \input{config.tex} \newglossaryentry{ka}{name=\ensuremath{k_a},description={{Actuator Stiffness in}}} @@ -13,6 +13,13 @@ \author{Dehaeze Thomas} \date{2021-05-19} \title{PhD Thesis} +\hypersetup{ + pdfauthor={Dehaeze Thomas}, + pdftitle={PhD Thesis}, + pdfkeywords={}, + pdfsubject={}, + pdfcreator={Emacs 27.2 (Org mode 9.5)}, + pdflang={English}} \begin{document} \maketitle @@ -20,15 +27,33 @@ \chapter{Test} -\label{sec:org7e1d1fa} +\label{sec:org602fc31} \section{Test} -\label{sec:org71711f0} +\label{sec:orgd35e72e} \begin{itemize} \item acronyms \gls{mimo}, \gls{siso}, and again \gls{mimo} \item glossary terms \gls{ka}, \gls{phi}. \item Bibliography citations: \cite{dehaeze21_activ_dampin_rotat_platf_using,dehaeze18_sampl_stabil_for_tomog_exper} \end{itemize} +\section{blabla} +\label{sec:org129c06d} +\subsection{sdlfk} +\label{sec:org2e5c262} + +\subsection{sldkjf asdf} +\label{sec:org7d13a1b} +\subsubsection{lksdfjasd} +\label{sec:orgb2b4c9c} +\subsubsection{lksdfjasd} +\label{sec:org9d3084d} +\subsubsection{lksdfjasd} +\label{sec:orgf226c03} +\section{blabla} +\label{sec:orgb398faf} +\chapter{Test} +\label{sec:org5dc49e4} + \printbibliography \printglossary[type=\acronymtype] diff --git a/setup.org b/setup.org new file mode 100644 index 0000000..f44ae28 --- /dev/null +++ b/setup.org @@ -0,0 +1,348 @@ +#+TITLE: Setup file +#+PROPERTY: header-args:latex :tangle config.tex + +* Babel +#+begin_src latex +\usepackage[french,english]{babel} +#+end_src + +* Figures +#+begin_src latex +\usepackage{graphicx} +\graphicspath{{figs/}} +#+end_src + +* Captions +#+begin_src latex +\usepackage{subcaption} +\captionsetup{subrefformat=parens} +#+end_src + +* Glossary +#+begin_src latex +\usepackage[ % + acronym, % Separate acronyms and glossary + toc, % appear in ToC + automake, % auto-use the makeglossaries command (requires shell-escape) + nonumberlist, % don't back reference pages + nogroupskip, % don't group by letter + nopostdot % don't add a dot at the end of each element +]{glossaries} + +\usepackage[stylemods=longextra]{glossaries-extra} + +\setabbreviationstyle[acronym]{long-short} +\setglossarystyle{long-name-desc} +#+end_src + +#+begin_src latex :tangle config_extra.tex +\makeindex +\makeglossaries +#+end_src + +* Lists +Do not modify itemize/enumerate environments by default +#+begin_src latex +\usepackage[olditem,oldenum]{paralist} +#+end_src + +* Spacing +#+begin_src latex +\RequirePackage{setspace} +\onehalfspacing +#+end_src + +* Tables +#+begin_src latex +\usepackage{booktabs} +\usepackage{multirow} +#+end_src + +* Units +#+begin_src latex +\usepackage[binary-units=true]{siunitx} + +\sisetup{% + detect-all = true, + detect-family = true, + detect-mode = true, + detect-shape = true, + detect-weight = true, + detect-inline-weight = math, +} + +\DeclareSIUnit\px{px} +\DeclareSIUnit\rms{rms} +#+end_src + +* Mathematics +#+begin_src latex +\usepackage{amsmath} +\usepackage{amsthm} +\usepackage{dsfont} +#+end_src + +Fix the spacing of =\left= and =\right=. +Use these with the proper bracket in order to ensure that they scale automatically. +#+begin_src latex +\let\originalleft\left +\let\originalright\right +\renewcommand{\left}{\mathopen{}\mathclose\bgroup\originalleft} +\renewcommand{\right}{\aftergroup\egroup\originalright} +#+end_src + +* Geometry + +# \usepackage[paperheight=24.41cm,paperwidth=17.21cm,bottom=3cm,left=1.4cm,right=2cm,heightrounded]{geometry} + +* Penalties +#+begin_src latex +\clubpenalty = 10000 +\widowpenalty = 10000 +\displaywidowpenalty = 10000 +#+end_src + +* Headers +#+begin_src latex +\usepackage{scrlayer-scrpage} + +\pagestyle{scrheadings} +#+end_src + +* Section/Figure format +#+begin_src latex +\renewcommand{\partformat}{\huge\partname~\thepart\autodot} +\renewcommand{\raggedpart}{\flushleft} + +\setkomafont{part}{\normalfont\huge\scshape} + +\setkomafont{sectioning}{\normalfont\scshape} +\setkomafont{descriptionlabel}{\normalfont\bfseries} + +\setkomafont{caption}{\small} +\setkomafont{captionlabel}{\usekomafont{caption}} + + +% Large number for chapter +\renewcommand*{\chapterformat}{% + \fontsize{50}{55}\selectfont\thechapter\autodot\enskip +} +#+end_src + +Improve chapter font colors and font size. +The following commands make chapter numbers BrickRed. +#+begin_src latex +\makeatletter +\renewcommand*{\chapterformat}{ \mbox{\chapappifchapterprefix{\nobreakspace}{\color{BrickRed}\fontsize{40}{45}\selectfont\thechapter}\autodot\enskip}} +\renewcommand\@seccntformat[1]{\color{BrickRed} {\csname the#1\endcsname}\hspace{0.3em}} +\makeatother +#+end_src + + +* Floating images configuration +By default, if a figure consumes 60% of the page it will get its own float-page. +To change that we have to adjust the value of the =floatpagefraction= derivative. +#+begin_src latex +\renewcommand{\floatpagefraction}{.8}% +#+end_src + +See more information [[https://tex.stackexchange.com/questions/68516/avoid-that-figure-gets-its-own-page][here]]. + +* Etoolbox package +#+begin_src latex +\usepackage{etoolbox} +#+end_src + +* Hyperref and Bookmarks +#+begin_src latex +\usepackage[ % + colorlinks=true, % + citecolor=BrickRed, % + linkcolor=BrickRed, % + urlcolor=BrickRed, % + unicode % + ]{hyperref} +#+end_src + +The bookmark package implements a new bookmark (outline) organisation for package hyperref. +This lets us change the "tree-navigation" associated with the generated pdf and constrain the menu only to H:2. + +#+begin_src latex +\usepackage{bookmark} + +\bookmarksetup{depth=2} +#+end_src + +* Bibliography + +#+begin_src latex +\usepackage[ % use biblatex for bibliography + backend=biber, % use biber backend (bibtex replacement) or bibtex + style=ieee, % bib style + hyperref=true, % activate hyperref support + backref=true, % activate backrefs + isbn=false, % don't show isbn tags + url=false, % don't show url tags + doi=false, % don't show doi tags + urldate=long, % display type for dates + maxnames=3, % + minnames=1, % + maxbibnames=5, % + minbibnames=3, % + maxcitenames=2, % + mincitenames=1 % + ]{biblatex} +#+end_src + +#+begin_src latex +\addbibresource{ref.bib} +#+end_src + +Remove ISSN, DOI and URL to shorten the bibliography. +#+begin_src latex +\AtEveryBibitem{% + \clearfield{urlyear} + \clearfield{urlmonth} + \clearfield{note} + \clearfield{issn} % Remove issn + \clearfield{doi} % Remove doi +\ifentrytype{online}{}{% Remove url except for @online + \clearfield{url} +} +} +#+end_src + +And increase the spacing between the entries, as per default they are too small. +#+begin_src latex +\setlength\bibitemsep{1.1\itemsep} +#+end_src + +Also reduce the font-size +#+begin_src latex +\renewcommand*{\bibfont}{\footnotesize} +#+end_src + +* Fonts + +https://tug.org/FontCatalogue/quattrocento/ +#+begin_src latex +\usepackage[sf, scaled=0.9]{quattrocento} +#+end_src + +https://tug.org/FontCatalogue/crimsonproregular/ +#+begin_src latex +\usepackage{crimson} +#+end_src + +https://tug.org/FontCatalogue/sourcecodepro/ +#+begin_src latex +\usepackage[oldstyle, scale=0.7]{sourcecodepro} +#+end_src + +* Colors +#+begin_src latex +\usepackage[usenames,dvipsnames]{xcolor} +#+end_src + +* CS Quotes +The [[https://ctan.org/pkg/csquotes][csquotes]] package offers context sensitive quotation facilities, improving the typesetting of inline quotes. + +#+begin_src latex +\usepackage{csquotes} +#+end_src + +To enclose quote environments with quotes from csquotes, see [[https://tex.stackexchange.com/questions/365231/enclose-a-custom-quote-environment-in-quotes-from-csquotes][the following TeX SE thread]]. + +#+begin_src latex +\def\signed #1{{\leavevmode\unskip\nobreak\hfil\penalty50\hskip1em + \hbox{}\nobreak\hfill #1% + \parfillskip=0pt \finalhyphendemerits=0 \endgraf}} + +\newsavebox\mybox +\newenvironment{aquote}[1] +{\savebox\mybox{#1}\begin{quote}\openautoquote\hspace*{-.7ex}} + {\unskip\closeautoquote\vspace*{1mm}\signed{\usebox\mybox}\end{quote}} +#+end_src + +And then use quotes as: +#+begin_example +# The options derivative adds text after the environment. We use it to add the author. +#+ATTR_LATEX: :options {\cite{Frahm1994}} +#+begin_aquote +/Current (fMRI) applications often rely on "effects" or "statistically significant differences", rather than on a proper analysis of the relationship between neuronal activity, haemodynamic consequences, and MRI physics./ +#+end_aquote +#+end_example + +Note that org-ref links won't work here because the attr latex will be pasted as-is in the .tex file. + +* Setspace for controlling line spacing + +#+begin_src latex +\usepackage{setspace} +\setstretch{1.25} +#+end_src + +* Parskip + +Fine tuning of spacing between paragraphs. See [[https://tex.stackexchange.com/questions/161254/smaller-parskip-than-half-for-koma-script][thread here]]. + +#+begin_src latex +\setparsizes{0em}{0.1\baselineskip plus .1\baselineskip}{1em plus 1fil} +#+end_src + +* Table improvements + +I reduce the size of tables so that longer tables can still fit into an A4 (reduce font and make sans serif). +#+begin_src latex +\usepackage{floatrow} +\floatsetup[table]{font={footnotesize,sf},capposition=top} +#+end_src + +* Possible Equation improvements + +Make the equation numbers follow the chapter, not the whole thesis. +#+begin_src latex +\numberwithin{equation}{chapter} +#+end_src + +* Minted + +The minted package is used for highlighting source code. +#+begin_src latex +\usepackage{listings} +\usepackage{minted} +\setminted{autogobble=true,fontsize=\small,baselinestretch=0.8} +\setminted[python]{python3=true,tabsize=4} +\usemintedstyle{trac} +\lstset{abovecaptionskip=0} +\renewcommand{\listingscaption}{Code Snippet} +#+end_src + +And reduce the distance between a minted listing and its caption. +#+begin_src latex +\AtEndEnvironment{listing}{\vspace{-16pt}} +#+end_src + +* Scrhack + +This package fixes some incompatibility errors between KOMAScript and other packages (namely minted). It has to be loaded at the end. +#+begin_src latex +\usepackage{scrhack} +#+end_src + +* Background cover page + +Add the cover image as background to the first page. Only do so when outputting a final version, because it significantly slows down the compilation times. + +#+begin_src latex :tangle no +\usepackage[pages=some]{background} +\backgroundsetup{ + scale=1, + color=black, + opacity=0.9, + angle=0, + contents={% + \includegraphics[width=\paperwidth,height=\paperheight]{/Users/user/Desktop/TectonicPlatesXVI.png} + }% +} +#+end_src