All written reports are pasted and it compiles
This commit is contained in:
260
setup.org
260
setup.org
@@ -1,71 +1,11 @@
|
||||
#+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}
|
||||
\usepackage{tabularx}
|
||||
#+end_src
|
||||
|
||||
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
|
||||
|
||||
* Units
|
||||
* Config
|
||||
:PROPERTIES:
|
||||
:header-args:latex: :tangle config.tex
|
||||
:END:
|
||||
** Units
|
||||
#+begin_src latex
|
||||
\usepackage[binary-units=true]{siunitx}
|
||||
|
||||
@@ -82,10 +22,11 @@ I reduce the size of tables so that longer tables can still fit into an A4 (redu
|
||||
\DeclareSIUnit\rms{rms}
|
||||
#+end_src
|
||||
|
||||
* Mathematics
|
||||
** Mathematics
|
||||
#+begin_src latex
|
||||
\usepackage{amsmath}
|
||||
\usepackage{amsthm}
|
||||
\usepackage{bm}
|
||||
\usepackage{dsfont}
|
||||
#+end_src
|
||||
|
||||
@@ -98,25 +39,94 @@ Use these with the proper bracket in order to ensure that they scale automatical
|
||||
\renewcommand{\right}{\aftergroup\egroup\originalright}
|
||||
#+end_src
|
||||
|
||||
* Geometry
|
||||
** 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
|
||||
|
||||
* Config Extra
|
||||
:PROPERTIES:
|
||||
:header-args:latex: :tangle config_extra.tex
|
||||
:END:
|
||||
** 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{caption}
|
||||
\usepackage{subcaption}
|
||||
\captionsetup{subrefformat=parens}
|
||||
|
||||
\captionsetup[figure]{labelfont=bf}
|
||||
\captionsetup[subfigure]{labelfont=bf}
|
||||
\captionsetup[listing]{labelfont=bf}
|
||||
\captionsetup[table]{labelfont=bf}
|
||||
#+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}
|
||||
\usepackage{tabularx}
|
||||
#+end_src
|
||||
|
||||
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
|
||||
|
||||
** Geometry
|
||||
|
||||
# \usepackage[paperheight=24.41cm,paperwidth=17.21cm,bottom=3cm,left=1.4cm,right=2cm,heightrounded]{geometry}
|
||||
|
||||
* Penalties
|
||||
** Penalties
|
||||
#+begin_src latex
|
||||
\clubpenalty = 10000
|
||||
\widowpenalty = 10000
|
||||
\displaywidowpenalty = 10000
|
||||
#+end_src
|
||||
|
||||
* Headers
|
||||
** Headers
|
||||
#+begin_src latex
|
||||
\usepackage{scrlayer-scrpage}
|
||||
|
||||
\pagestyle{scrheadings}
|
||||
#+end_src
|
||||
|
||||
* Section/Figure format
|
||||
** Section/Figure format
|
||||
#+begin_src latex
|
||||
\renewcommand{\partformat}{\huge\partname~\thepart\autodot}
|
||||
\renewcommand{\raggedpart}{\flushleft}
|
||||
@@ -143,8 +153,7 @@ The following commands make chapter numbers BrickRed.
|
||||
\makeatother
|
||||
#+end_src
|
||||
|
||||
|
||||
* Floating images configuration
|
||||
** 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
|
||||
@@ -153,12 +162,14 @@ To change that we have to adjust the value of the =floatpagefraction= derivative
|
||||
|
||||
See more information [[https://tex.stackexchange.com/questions/68516/avoid-that-figure-gets-its-own-page][here]].
|
||||
|
||||
* Etoolbox package
|
||||
** Etoolbox package
|
||||
#+begin_src latex
|
||||
\usepackage{etoolbox}
|
||||
|
||||
\pretocmd{\section}{\clearpage}{}{}
|
||||
#+end_src
|
||||
|
||||
* Hyperref and Bookmarks
|
||||
** Hyperref and Bookmarks
|
||||
#+begin_src latex
|
||||
\usepackage[ %
|
||||
colorlinks=true, %
|
||||
@@ -167,6 +178,8 @@ See more information [[https://tex.stackexchange.com/questions/68516/avoid-that-
|
||||
urlcolor=BrickRed, %
|
||||
unicode %
|
||||
]{hyperref}
|
||||
|
||||
\usepackage{hypcap}
|
||||
#+end_src
|
||||
|
||||
The bookmark package implements a new bookmark (outline) organisation for package hyperref.
|
||||
@@ -178,7 +191,17 @@ This lets us change the "tree-navigation" associated with the generated pdf and
|
||||
\bookmarksetup{depth=2}
|
||||
#+end_src
|
||||
|
||||
* Bibliography
|
||||
** Use pdf instead of png
|
||||
#+begin_src latex
|
||||
\makeatletter
|
||||
\preto\Gin@extensions{png,}
|
||||
\DeclareGraphicsRule{.png}{pdf}{.pdf}{\noexpand\Gin@base.pdf}
|
||||
\preto\Gin@extensions{gif,}
|
||||
\DeclareGraphicsRule{.gif}{png}{.png}{\noexpand\Gin@base.png}
|
||||
\makeatother
|
||||
#+end_src
|
||||
|
||||
** Bibliography
|
||||
|
||||
#+begin_src latex
|
||||
\usepackage{xpatch} % Recommanded for biblatex
|
||||
@@ -236,7 +259,7 @@ Also reduce the font-size
|
||||
\renewcommand*{\bibfont}{\footnotesize}
|
||||
#+end_src
|
||||
|
||||
* Table of Contents for each chapter
|
||||
** Table of Contents for each chapter
|
||||
Note that this is marked as deprecated for koma-script.
|
||||
#+begin_src latex
|
||||
\usepackage{minitoc}
|
||||
@@ -247,39 +270,55 @@ Note that this is marked as deprecated for koma-script.
|
||||
% \usepackage[nottoc]{tocbibind}
|
||||
#+end_src
|
||||
|
||||
* Fonts
|
||||
** TODO Fonts
|
||||
|
||||
#+begin_src latex
|
||||
\ifxetexorluatex
|
||||
\usepackage{unicode-math}
|
||||
% \usepackage{unicode-math} % It seems I don't need that as I don't want to use unicode char
|
||||
\usepackage{fontspec}
|
||||
\setmainfont{EB Garamond}
|
||||
\setmathfont{Garamond Math}
|
||||
% \setmathfont{Garamond Math}
|
||||
|
||||
% Load some missing symbols from another font.
|
||||
\setmathfont{STIX Two Math}[%
|
||||
range = {
|
||||
\sharp,
|
||||
\natural,
|
||||
\flat,
|
||||
\clubsuit,
|
||||
\spadesuit,
|
||||
\checkmark
|
||||
}
|
||||
]
|
||||
\setmonofont[Scale=MatchLowercase]{Source Code Pro}
|
||||
% % Load some missing symbols from another font.
|
||||
% \setmathfont{STIX Two Math}[%
|
||||
% range = {
|
||||
% \sharp,
|
||||
% \natural,
|
||||
% \flat,
|
||||
% \clubsuit,
|
||||
% \spadesuit,
|
||||
% \checkmark
|
||||
% }
|
||||
% ]
|
||||
% \setmonofont[Scale=MatchLowercase]{Source Code Pro}
|
||||
\else
|
||||
\usepackage[lf]{ebgaramond} % https://tug.org/FontCatalogue/quattrocento/
|
||||
% \usepackage[lf]{ebgaramond} % https://tug.org/FontCatalogue/quattrocento/
|
||||
\usepackage[oldstyle,scale=0.7]{sourcecodepro} % https://tug.org/FontCatalogue/sourcecodepro/
|
||||
\singlespacing
|
||||
\fi
|
||||
#+end_src
|
||||
|
||||
* Colors
|
||||
** Colors
|
||||
#+begin_src latex
|
||||
\usepackage[usenames,dvipsnames]{xcolor}
|
||||
|
||||
\definecolor{my-blue}{HTML}{6b7adb}
|
||||
\definecolor{my-pale-blue}{HTML}{e6e9f9}
|
||||
\definecolor{my-red}{HTML}{db6b6b}
|
||||
\definecolor{my-pale-red}{HTML}{f9e6e6}
|
||||
\definecolor{my-green}{HTML}{6bdbb6}
|
||||
\definecolor{my-pale-green}{HTML}{e6f9f3}
|
||||
\definecolor{my-yellow}{HTML}{dbd26b}
|
||||
\definecolor{my-pale-yellow}{HTML}{f9f7e6}
|
||||
\definecolor{my-orange}{HTML}{dba76b}
|
||||
\definecolor{my-pale-orange}{HTML}{f9f0e6}
|
||||
\definecolor{my-grey}{HTML}{a3a3a3}
|
||||
\definecolor{my-pale-grey}{HTML}{f0f0f0}
|
||||
\definecolor{my-turq}{HTML}{6bc7db}
|
||||
\definecolor{my-pale-turq}{HTML}{e6f6f9}
|
||||
#+end_src
|
||||
|
||||
* CS Quotes
|
||||
** CS Quotes
|
||||
The [[https://ctan.org/pkg/csquotes][csquotes]] package offers context sensitive quotation facilities, improving the typesetting of inline quotes.
|
||||
|
||||
#+begin_src latex
|
||||
@@ -310,28 +349,28 @@ And then use quotes as:
|
||||
|
||||
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
|
||||
** Setspace for controlling line spacing
|
||||
|
||||
#+begin_src latex
|
||||
\usepackage{setspace}
|
||||
\setstretch{1.25}
|
||||
#+end_src
|
||||
|
||||
* Parskip
|
||||
** 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
|
||||
|
||||
* Possible Equation improvements
|
||||
** Possible Equation improvements
|
||||
|
||||
Make the equation numbers follow the chapter, not the whole thesis.
|
||||
#+begin_src latex
|
||||
\numberwithin{equation}{chapter}
|
||||
#+end_src
|
||||
|
||||
* Minted
|
||||
** Minted
|
||||
|
||||
The minted package is used for highlighting source code.
|
||||
#+begin_src latex
|
||||
@@ -349,14 +388,19 @@ And reduce the distance between a minted listing and its caption.
|
||||
\AtEndEnvironment{listing}{\vspace{-16pt}}
|
||||
#+end_src
|
||||
|
||||
* Scrhack
|
||||
#+begin_src matlab
|
||||
\let\OldTexttt\texttt
|
||||
\renewcommand{\texttt}[1]{{\ttfamily\hl{\mbox{\,#1\,}}}}
|
||||
#+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
|
||||
** 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
|
||||
@@ -371,3 +415,19 @@ Add the cover image as background to the first page. Only do so when outputting
|
||||
}%
|
||||
}
|
||||
#+end_src
|
||||
|
||||
** Various
|
||||
#+begin_src latex
|
||||
\usepackage{float}
|
||||
\usepackage{enumitem}
|
||||
|
||||
% highlight
|
||||
\usepackage{soul}
|
||||
\sethlcolor{my-pale-grey}
|
||||
#+end_src
|
||||
|
||||
** Index and glossaries
|
||||
#+begin_src latex
|
||||
\makeindex
|
||||
\makeglossaries
|
||||
#+end_src
|
||||
|
Reference in New Issue
Block a user