├── .envrc ├── figures ├── institution-logo.pdf └── Professortocat_v2.png ├── .latexmkrc ├── 990-appendix.tex ├── 005-titlepage.tex ├── flake.lock ├── biblio.bib ├── code └── P15601_en_Harrichu_y_and_the_maze.cc ├── README.md ├── flake.nix ├── 000-main.tex ├── 010-introduction.tex ├── .gitignore └── 001-preamble.tex /.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | -------------------------------------------------------------------------------- /figures/institution-logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Leixb/latex-template/HEAD/figures/institution-logo.pdf -------------------------------------------------------------------------------- /.latexmkrc: -------------------------------------------------------------------------------- 1 | $pdf_mode = 4; 2 | @default_files = ('000-main.tex'); 3 | $lualatex = "lualatex %O -shell-escape %S"; 4 | -------------------------------------------------------------------------------- /figures/Professortocat_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Leixb/latex-template/HEAD/figures/Professortocat_v2.png -------------------------------------------------------------------------------- /990-appendix.tex: -------------------------------------------------------------------------------- 1 | %! TEX root = **/000-main.tex 2 | % vim: spell spelllang=en: 3 | 4 | \section{Appendix} 5 | 6 | Appendix contents 7 | 8 | \inputminted{cpp}{./code/P15601_en_Harrichu_y_and_the_maze.cc} 9 | -------------------------------------------------------------------------------- /005-titlepage.tex: -------------------------------------------------------------------------------- 1 | %! TEX root = **/000-main.tex 2 | % vim: spell spelllang=en: 3 | 4 | \thispagestyle{empty} 5 | \clearpage 6 | \setcounter{page}{-1} 7 | 8 | \makeatletter 9 | \begin{titlepage} 10 | { 11 | \centering 12 | \includegraphics[width=0.9\textwidth]{institution-logo} 13 | \null% 14 | \vspace{3em} 15 | {\Huge \bfseries \@title \par} 16 | \vspace{2em} 17 | {\large \scshape \@date \par} 18 | \vfill 19 | \begin{center} 20 | % Supplementary image 21 | \end{center} 22 | \vspace{5em} 23 | 24 | \vfill 25 | {\raggedleft \large \@author \par} 26 | } 27 | \end{titlepage} 28 | \makeatother 29 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "flake-utils": { 4 | "locked": { 5 | "lastModified": 1638122382, 6 | "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", 7 | "owner": "numtide", 8 | "repo": "flake-utils", 9 | "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", 10 | "type": "github" 11 | }, 12 | "original": { 13 | "owner": "numtide", 14 | "repo": "flake-utils", 15 | "type": "github" 16 | } 17 | }, 18 | "nixpkgs": { 19 | "locked": { 20 | "lastModified": 1641285291, 21 | "narHash": "sha256-KYaOBNGar3XWTxTsYPr9P6u74KAqNq0wobEC236U+0c=", 22 | "owner": "NixOS", 23 | "repo": "nixpkgs", 24 | "rev": "0432195a4b8d68faaa7d3d4b355260a3120aeeae", 25 | "type": "github" 26 | }, 27 | "original": { 28 | "id": "nixpkgs", 29 | "type": "indirect" 30 | } 31 | }, 32 | "root": { 33 | "inputs": { 34 | "flake-utils": "flake-utils", 35 | "nixpkgs": "nixpkgs" 36 | } 37 | } 38 | }, 39 | "root": "root", 40 | "version": 7 41 | } 42 | -------------------------------------------------------------------------------- /biblio.bib: -------------------------------------------------------------------------------- 1 | % vim: spell spelllang=en: 2 | 3 | @article{einstein, 4 | author = "Albert Einstein", 5 | title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German}) 6 | [{On} the electrodynamics of moving bodies]", 7 | journal = "Annalen der Physik", 8 | volume = "322", 9 | number = "10", 10 | pages = "891--921", 11 | year = "1905", 12 | DOI = "http://dx.doi.org/10.1002/andp.19053221004", 13 | keywords = "physics" 14 | } 15 | 16 | @book{dirac, 17 | title = {The Principles of Quantum Mechanics}, 18 | author = {Paul Adrien Maurice Dirac}, 19 | isbn = {9780198520115}, 20 | series = {International series of monographs on physics}, 21 | year = {1981}, 22 | publisher = {Clarendon Press}, 23 | keywords = {physics} 24 | } 25 | 26 | @online{knuthwebsite, 27 | author = "Donald Knuth", 28 | title = "Knuth: Computers and Typesetting", 29 | url = "http://www-cs-faculty.stanford.edu/~uno/abcde.html", 30 | addendum = "(accessed: 01.09.2016)", 31 | keywords = "latex,knuth" 32 | } 33 | 34 | @inbook{knuth-fa, 35 | author = "Donald E. Knuth", 36 | title = "Fundamental Algorithms", 37 | publisher = "Addison-Wesley", 38 | year = "1973", 39 | chapter = "1.2", 40 | keywords = "knuth,programming" 41 | } 42 | -------------------------------------------------------------------------------- /code/P15601_en_Harrichu_y_and_the_maze.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | using namespace std; 5 | 6 | struct coord { 7 | int x,y; 8 | coord (int xx=0, int yy=0) : x(xx), y(yy) {} 9 | bool operator== (const coord& p) {return x==p.x and y==p.y;} 10 | } beg, goal; 11 | 12 | int main () { 13 | int n; 14 | cin >> n; 15 | while (n--) { 16 | int r,c; 17 | cin >> r >> c; 18 | vector > v (r, vector (c, 0)); 19 | for (int i = 0; i < r; ++i) 20 | for (int j = 0; j < c; ++j) { 21 | char cc; 22 | cin >> cc; 23 | if (cc=='.') v[i][j]=true; 24 | else if (cc=='b') beg = coord(i,j); 25 | else if (cc=='g') goal = coord(i,j); 26 | } 27 | 28 | v[goal.x][goal.y] = v[beg.x][beg.y]=true; 29 | vector > f (v.size(),vector (v[0].size(),0)); 30 | 31 | queue q; 32 | q.push(beg); 33 | 34 | while (!q.empty()) { 35 | coord p = q.front(); q.pop(); 36 | if (p.x>=v.size() or p.x<0 or p.y >= v[0].size() or p.y<0) continue; 37 | if (!v[p.x][p.y]) continue; 38 | if (f[p.x][p.y]) continue; 39 | 40 | f[p.x][p.y] = true; 41 | if (p==goal) break; 42 | 43 | q.push(coord(p.x+1,p.y)); 44 | q.push(coord(p.x-1,p.y)); 45 | q.push(coord(p.x,p.y+1)); 46 | q.push(coord(p.x,p.y-1)); 47 | } 48 | 49 | cout << (f[goal.x][goal.y]? "Good" : "Bad") << endl; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | LaTeX flake template 2 | ==================== 3 | 4 | `LaTeX` template that I use as a starting point for all my documents. It is 5 | structured in multiple files ordered numerically. To compile simply 6 | run `latexmk`. 7 | 8 | Flakes 9 | ------ 10 | 11 | There is no need to use `flakes`, this template can be used with any working 12 | `LaTeX` installation, but `flakes` allow for build reproducibility and a 13 | standardized environment across all collaborators. This means that all the 14 | `LaTeX` dependencies, `pygmentize` and all other dependencies are managed with 15 | `nix`, allowing to compile the document without working about managing the 16 | dependencies in different environments. 17 | 18 | This makes it very easy to integrate the document deployment with [github 19 | actions](https://github.com/marketplace/actions/install-nix#usage-with-flakes), 20 | any other CI or [creating containers](https://nix.dev/tutorials/building-and-running-docker-images) 21 | to build the document. Using, binary caches with `cachix` can speed up the 22 | compilation significantly by caching all LaTeX packages. 23 | 24 | To build the current in the current directory run: 25 | 26 | ``` 27 | nix build 28 | ``` 29 | 30 | Or even compile the document without even cloning it before hand with: 31 | 32 | ``` 33 | nix build github:leixb/latex-template 34 | ``` 35 | 36 | To get a shell with all the dependencies available: 37 | 38 | ``` 39 | nix develop 40 | ``` 41 | 42 | Note that you can use [direnv](https://github.com/direnv/direnv) 43 | to have a controlled development environment for the document integrated 44 | with your shell. 45 | 46 | (All this commands are using nix 2.4 with flake support) 47 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Build LaTeX document with minted"; 3 | 4 | inputs.flake-utils.url = "github:numtide/flake-utils"; 5 | 6 | outputs = { self, nixpkgs, flake-utils }: 7 | { 8 | templates.document = { 9 | path = ./.; 10 | description = "LaTeX document with minted support"; 11 | }; 12 | 13 | lib.latexmk = import ./build-document.nix; 14 | 15 | defaultTemplate = self.templates.document; 16 | } // flake-utils.lib.eachDefaultSystem (system: 17 | let 18 | pkgs = import nixpkgs { inherit system; }; 19 | 20 | latex-packages = with pkgs; [ 21 | (texlive.combine { 22 | inherit (texlive) 23 | scheme-medium 24 | framed 25 | titlesec 26 | cleveref 27 | multirow 28 | wrapfig 29 | tabu 30 | threeparttable 31 | threeparttablex 32 | makecell 33 | environ 34 | biblatex 35 | biber 36 | fvextra 37 | upquote 38 | catchfile 39 | xstring 40 | csquotes 41 | minted 42 | dejavu 43 | comment 44 | footmisc 45 | xltabular 46 | ltablex 47 | ; 48 | }) 49 | which 50 | python39Packages.pygments 51 | ]; 52 | 53 | dev-packages = with pkgs; [ 54 | texlab 55 | zathura 56 | wmctrl 57 | ]; 58 | in 59 | rec { 60 | devShell = pkgs.mkShell { 61 | buildInputs = [ latex-packages dev-packages ]; 62 | }; 63 | 64 | packages = flake-utils.lib.flattenTree { 65 | document = import ./build-document.nix { 66 | inherit pkgs; 67 | texlive = latex-packages; 68 | shellEscape = true; 69 | minted = true; 70 | SOURCE_DATE_EPOCH = toString self.lastModified; 71 | }; 72 | }; 73 | 74 | defaultPackage = packages.document; 75 | } 76 | ); 77 | } 78 | -------------------------------------------------------------------------------- /000-main.tex: -------------------------------------------------------------------------------- 1 | %! TEX root = **/000-main.tex 2 | % vim: spell spelllang=en: 3 | 4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | % PREAMBLE 6 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 7 | \input{001-preamble} 8 | 9 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 10 | % EXTRA PACKAGES / CONFIG 11 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 12 | 13 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 | % METADATA 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | 17 | % remove when using \maketitle: 18 | \renewcommand\and{\\[\baselineskip]} 19 | 20 | \title{My title \\ \Large \normalfont My Subtitle} 21 | \author{First Author \and Second Author} 22 | \date{\today} 23 | 24 | \begin{document} 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | % TITLE 27 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 28 | 29 | % Default title or use titlepage.tex 30 | 31 | %\maketitle 32 | \include{005-titlepage} 33 | 34 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 35 | % TOC & lists 36 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 37 | 38 | \pagenumbering{Roman} 39 | 40 | %\setcounter{tocdepth}{2} 41 | \tableofcontents \pagebreak 42 | 43 | \listoffigures \pagebreak 44 | \listoftables \clearpage 45 | 46 | \pagenumbering{arabic} 47 | 48 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 49 | % SECTIONS 50 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 51 | 52 | % Paragraph spacing (placed after ToC) 53 | \setlength{\parskip}{1em plus 0.5em minus 0.2em} 54 | %\setlength{\parindent}{0pt} 55 | 56 | \include{010-introduction} 57 | 58 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 59 | % BIBLIO 60 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 61 | 62 | \printbibliography[heading=bibintoc] 63 | 64 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 65 | % APPENDIX 66 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 67 | 68 | % uncomment to add appendix section prefix to numbering 69 | %\appendixpagenumbering 70 | 71 | \appendix 72 | 73 | \include{990-appendix} 74 | 75 | \end{document} 76 | -------------------------------------------------------------------------------- /010-introduction.tex: -------------------------------------------------------------------------------- 1 | %! TEX root = **/000-main.tex 2 | % vim: spell spelllang=en: 3 | 4 | \section{Introduction}% 5 | \label{sec:introduction} 6 | 7 | \(E = mc^2\) \cite{einstein} 8 | 9 | \begin{figure}[H] 10 | \centering 11 | \includegraphics[width=0.3\linewidth]{Professortocat_v2} 12 | \caption{Professor OctoCat}% 13 | \label{fig:profocto} 14 | \end{figure} 15 | 16 | As we can see in \cref{fig:profocto}, the professor is holding an apple. 17 | 18 | \begin{table}[H] 19 | \begin{center} 20 | \caption{Table captions go on top of the tables}% 21 | \label{tab:example} 22 | \begin{tabular}{ccc} 23 | \toprule 24 | a & b & c \\ 25 | \midrule 26 | 0 & 2 & 4 \\ 27 | \bottomrule 28 | \end{tabular} 29 | \end{center} 30 | \end{table} 31 | 32 | \subsection{Lorem ipsum}% 33 | \label{sub:lorem_ipsum} 34 | 35 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ultricies est sit amet interdum ornare. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut nulla lectus, bibendum ultrices dui quis, sodales suscipit quam. Donec eu finibus lectus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Etiam eu metus mattis, bibendum massa quis, eleifend libero. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nunc lacinia ipsum at dolor tristique convallis. Sed dignissim malesuada nunc, nec malesuada risus sagittis eu. Nulla et erat et mi elementum scelerisque vitae at neque. Suspendisse scelerisque laoreet tellus, sit amet accumsan mauris placerat nec. Vestibulum mollis augue a odio posuere, ut gravida est lacinia. Etiam turpis ligula, molestie nec porta in, malesuada id magna. Donec elementum nulla ac tincidunt fringilla. Suspendisse porta laoreet nisl, non aliquam orci dictum egestas. 36 | 37 | Proin euismod consequat felis ut pharetra. Maecenas auctor, nunc ac gravida pretium, metus mi fringilla lectus, auctor scelerisque nunc velit id magna. Etiam sit amet mi sit amet nunc congue ornare non hendrerit diam. Nullam consectetur lectus quis urna vehicula, nec lacinia tortor rhoncus. Vestibulum at enim aliquam, ultricies urna sit amet, porta tellus. Curabitur posuere elit orci, et rutrum nibh cursus eget. Donec ac venenatis purus. Fusce vehicula nisi erat, at tempor turpis congue vitae. Nunc auctor pellentesque malesuada. Nunc sodales, dolor ac sagittis mollis, enim ipsum mollis sem, non porttitor arcu nulla at velit. Ut non velit nec lacus sollicitudin maximus id id tortor. Sed ac aliquam lorem. 38 | 39 | Nunc non ante ex. Curabitur lacinia euismod velit, non posuere leo bibendum non. Mauris ac orci non risus feugiat rutrum eu ac velit. Phasellus facilisis lacinia condimentum. Pellentesque vulputate nibh urna, vel varius mauris cursus quis. Aliquam vitae sem ac orci fermentum semper. Praesent est tellus, luctus sed venenatis at, bibendum id purus. Cras at mi sed lorem aliquet congue at sit amet turpis. Aliquam vestibulum tempor mauris, id aliquam ipsum scelerisque ut. In arcu turpis, dapibus ut nisi vel, luctus pellentesque felis. Aenean nisi erat, porttitor eu felis ut, imperdiet aliquam velit. Mauris vitae vehicula leo. Curabitur ut ante et ante pulvinar gravida. Donec tincidunt fringilla erat. Vivamus cursus augue et odio pharetra hendrerit. 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # nix build output 2 | result 3 | 4 | ## PDF output (but not in figures/) 5 | *.pdf 6 | !figures/*.pdf 7 | !figures/**/*.pdf 8 | 9 | ## Core latex/pdflatex auxiliary files: 10 | *.aux 11 | *.lof 12 | *.log 13 | *.lot 14 | *.fls 15 | *.out 16 | *.toc 17 | *.fmt 18 | *.fot 19 | *.cb 20 | *.cb2 21 | .*.lb 22 | 23 | ## Intermediate documents: 24 | *.dvi 25 | *.xdv 26 | *-converted-to.* 27 | # these rules might exclude image files for figures etc. 28 | # *.ps 29 | # *.eps 30 | # *.pdf 31 | 32 | ## Generated if empty string is given at "Please type another file name for output:" 33 | .pdf 34 | 35 | ## Bibliography auxiliary files (bibtex/biblatex/biber): 36 | *.bbl 37 | *.bcf 38 | *.blg 39 | *-blx.aux 40 | *-blx.bib 41 | *.run.xml 42 | 43 | ## Build tool auxiliary files: 44 | *.fdb_latexmk 45 | *.synctex 46 | *.synctex(busy) 47 | *.synctex.gz 48 | *.synctex.gz(busy) 49 | *.pdfsync 50 | 51 | ## Build tool directories for auxiliary files 52 | # latexrun 53 | latex.out/ 54 | 55 | ## Auxiliary and intermediate files from other packages: 56 | # algorithms 57 | *.alg 58 | *.loa 59 | 60 | # achemso 61 | acs-*.bib 62 | 63 | # amsthm 64 | *.thm 65 | 66 | # beamer 67 | *.nav 68 | *.pre 69 | *.snm 70 | *.vrb 71 | 72 | # changes 73 | *.soc 74 | 75 | # comment 76 | *.cut 77 | 78 | # cprotect 79 | *.cpt 80 | 81 | # elsarticle (documentclass of Elsevier journals) 82 | *.spl 83 | 84 | # endnotes 85 | *.ent 86 | 87 | # fixme 88 | *.lox 89 | 90 | # feynmf/feynmp 91 | *.mf 92 | *.mp 93 | *.t[1-9] 94 | *.t[1-9][0-9] 95 | *.tfm 96 | 97 | #(r)(e)ledmac/(r)(e)ledpar 98 | *.end 99 | *.?end 100 | *.[1-9] 101 | *.[1-9][0-9] 102 | *.[1-9][0-9][0-9] 103 | *.[1-9]R 104 | *.[1-9][0-9]R 105 | *.[1-9][0-9][0-9]R 106 | *.eledsec[1-9] 107 | *.eledsec[1-9]R 108 | *.eledsec[1-9][0-9] 109 | *.eledsec[1-9][0-9]R 110 | *.eledsec[1-9][0-9][0-9] 111 | *.eledsec[1-9][0-9][0-9]R 112 | 113 | # glossaries 114 | *.acn 115 | *.acr 116 | *.glg 117 | *.glo 118 | *.gls 119 | *.glsdefs 120 | *.lzo 121 | *.lzs 122 | 123 | # uncomment this for glossaries-extra (will ignore makeindex's style files!) 124 | # *.ist 125 | 126 | # gnuplottex 127 | *-gnuplottex-* 128 | 129 | # gregoriotex 130 | *.gaux 131 | *.gtex 132 | 133 | # htlatex 134 | *.4ct 135 | *.4tc 136 | *.idv 137 | *.lg 138 | *.trc 139 | *.xref 140 | 141 | # hyperref 142 | *.brf 143 | 144 | # knitr 145 | *-concordance.tex 146 | # TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files 147 | # *.tikz 148 | *-tikzDictionary 149 | 150 | # listings 151 | *.lol 152 | 153 | # luatexja-ruby 154 | *.ltjruby 155 | 156 | # makeidx 157 | *.idx 158 | *.ilg 159 | *.ind 160 | 161 | # minitoc 162 | *.maf 163 | *.mlf 164 | *.mlt 165 | *.mtc[0-9]* 166 | *.slf[0-9]* 167 | *.slt[0-9]* 168 | *.stc[0-9]* 169 | 170 | # minted 171 | _minted* 172 | *.pyg 173 | 174 | # morewrites 175 | *.mw 176 | 177 | # nomencl 178 | *.nlg 179 | *.nlo 180 | *.nls 181 | 182 | # pax 183 | *.pax 184 | 185 | # pdfpcnotes 186 | *.pdfpc 187 | 188 | # sagetex 189 | *.sagetex.sage 190 | *.sagetex.py 191 | *.sagetex.scmd 192 | 193 | # scrwfile 194 | *.wrt 195 | 196 | # sympy 197 | *.sout 198 | *.sympy 199 | sympy-plots-for-*.tex/ 200 | 201 | # pdfcomment 202 | *.upa 203 | *.upb 204 | 205 | # pythontex 206 | *.pytxcode 207 | pythontex-files-*/ 208 | 209 | # tcolorbox 210 | *.listing 211 | 212 | # thmtools 213 | *.loe 214 | 215 | # TikZ & PGF 216 | *.dpth 217 | *.md5 218 | *.auxlock 219 | 220 | # todonotes 221 | *.tdo 222 | 223 | # vhistory 224 | *.hst 225 | *.ver 226 | 227 | # easy-todo 228 | *.lod 229 | 230 | # xcolor 231 | *.xcp 232 | 233 | # xmpincl 234 | *.xmpi 235 | 236 | # xindy 237 | *.xdy 238 | 239 | # xypic precompiled matrices and outlines 240 | *.xyc 241 | *.xyd 242 | 243 | # endfloat 244 | *.ttt 245 | *.fff 246 | 247 | # Latexian 248 | TSWLatexianTemp* 249 | 250 | ## Editors: 251 | # WinEdt 252 | *.bak 253 | *.sav 254 | 255 | # Texpad 256 | .texpadtmp 257 | 258 | # LyX 259 | *.lyx~ 260 | 261 | # Kile 262 | *.backup 263 | 264 | # gummi 265 | .*.swp 266 | 267 | # KBibTeX 268 | *~[0-9]* 269 | 270 | # TeXnicCenter 271 | *.tps 272 | 273 | # auto folder when using emacs and auctex 274 | ./auto/* 275 | *.el 276 | 277 | # expex forward references with \gathertags 278 | *-tags.tex 279 | 280 | # standalone packages 281 | *.sta 282 | 283 | # Makeindex log files 284 | *.lpz 285 | 286 | # xwatermark package 287 | *.xwm 288 | 289 | # REVTeX puts footnotes in the bibliography by default, unless the nofootinbib 290 | # option is specified. Footnotes are the stored in a file with suffix Notes.bib. 291 | # Uncomment the next line to have this generated file ignored. 292 | #*Notes.bib 293 | -------------------------------------------------------------------------------- /001-preamble.tex: -------------------------------------------------------------------------------- 1 | %! TEX root = **/000-main.tex 2 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3 | %% LaTeX preamble, load in main.tex with: \input{preamble} 4 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | 6 | \documentclass[12pt, oneside]{article} 7 | \usepackage[a4paper, left=2.5cm, right=2.5cm, top=2.5cm, bottom=2.5cm]{geometry} 8 | 9 | % for debugging overfulls 10 | %\documentclass[draft, 12pt, oneside]{article} 11 | %\usepackage[showframe, a4paper, left=2.5cm, right=2.5cm, top=2.5cm, bottom=2.5cm]{geometry} 12 | 13 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 | %% FONTS 15 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 16 | 17 | \usepackage[T1]{fontenc} 18 | \usepackage{fontspec} 19 | \usepackage{microtype} 20 | 21 | \setmonofont[Scale=MatchLowercase]{DejaVu Sans Mono} 22 | 23 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 24 | %% LANGUAGE 25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 26 | 27 | \usepackage{polyglossia} 28 | \setdefaultlanguage{english} 29 | \setotherlanguages{spanish,catalan} 30 | 31 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 32 | %% BIBLIOGRAPHY 33 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 34 | 35 | \usepackage[ 36 | backend=biber, 37 | style=numeric, 38 | ]{biblatex} 39 | \DeclareNameAlias{default}{family-given} 40 | 41 | \addbibresource{biblio.bib} 42 | 43 | \usepackage{fvextra} % Req by minted (must load before csquotes) 44 | \usepackage{csquotes} % For bibliography quotations 45 | \DeclareQuoteAlias{spanish}{catalan} 46 | 47 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 48 | %% COMMON 49 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 50 | 51 | \usepackage{color, xcolor} % more colors 52 | 53 | \usepackage{graphicx} % graphics 54 | \graphicspath{{./figures/}} 55 | 56 | \usepackage{comment} 57 | 58 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 59 | %% MATHS 60 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 61 | 62 | \usepackage{mathtools} % amsmath + more 63 | \usepackage{amsthm} % Theorem enviroment 64 | \usepackage{amssymb} % More symbols 65 | \usepackage{amstext} % Text inside mathenv 66 | 67 | %\usepackage{relsize} % Bigger math with mathlarger{___} 68 | %\usepackage{nicefrac} % nice fractions in one line 69 | 70 | %\usepackage{IEEEtrantools} % Complex equation arrays 71 | 72 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 73 | %% REFERENCES (load order is important) 74 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 75 | 76 | \usepackage{varioref} % reference far away (1) 77 | \usepackage[colorlinks = true]{hyperref} % links in references (2) 78 | \usepackage{cleveref} % smart references (3) 79 | %hyperref configuration so that it doesn't contrast so much colorlinks, 80 | \hypersetup{ 81 | linkcolor={black}, 82 | citecolor={black}, 83 | %linkcolor={red!50!black}, 84 | %citecolor={blue!50!black}, 85 | urlcolor={blue!80!black} 86 | } 87 | 88 | \usepackage[bottom]{footmisc} % Footnotes at bottom of page 89 | 90 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 91 | %% FIGURES 92 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 93 | 94 | %\usepackage[export]{adjustbox} % Adjust table size 95 | \usepackage{float} % Force tables and images position (H and H!) 96 | %\usepackage{wrapfig} % Wrap images like in HTML 97 | 98 | \usepackage[justification=centering]{caption} 99 | %\usepackage{subcaption} % Subfigures 100 | %\usepackage[framemethod=tikz]{mdframed} % Custom frames 101 | 102 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 103 | %% TABLES 104 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 105 | 106 | %\usepackage{colortbl, booktabs} % Better tables 107 | %\usepackage{tabularx} 108 | %\usepackage{longtable} % Multiple page table (does not work with tabularx) 109 | \usepackage{xltabular, colortbl, booktabs} % longtable + tabularx (has bug with booktabs: fix below) 110 | 111 | % Split cell in lines and more formating options inside table 112 | \usepackage{array, multirow, multicol, makecell} 113 | 114 | %%% 115 | % bug fix for booktabs + xltabular incompatibility 116 | \makeatletter 117 | \def\@BTrule[#1]{% 118 | \ifx\longtable\undefined 119 | \let\@BTswitch\@BTnormal 120 | \else\ifx\hline\LT@hline 121 | \nobreak 122 | \let\@BTswitch\@BLTrule 123 | \else 124 | \let\@BTswitch\@BTnormal 125 | \fi\fi 126 | \global\@thisrulewidth=#1\relax 127 | \ifnum\@thisruleclass=\tw@\vskip\@aboverulesep\else 128 | \ifnum\@lastruleclass=\z@\vskip\@aboverulesep\else 129 | \ifnum\@lastruleclass=\@ne\vskip\doublerulesep\fi\fi\fi 130 | \@BTswitch} 131 | \makeatother 132 | %%% 133 | 134 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 135 | %% SIUNITX 136 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 137 | 138 | %\usepackage[alsoload=hep]{siunitx} % SI units and uncertainties 139 | %\sisetup{locale = FR} % Commas and so on for spanish 140 | %\sisetup{separate-uncertainty=true} 141 | %\sisetup{ 142 | %per-mode=fraction, 143 | %fraction-function=\nicefrac 144 | %} 145 | 146 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 147 | %% TIKZ 148 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 149 | 150 | %\usepackage{tikz} 151 | %\usetikzlibrary{arrows} 152 | %\usetikzlibrary{scopes} 153 | %\usetikzlibrary{babel} 154 | 155 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 156 | %% MINTED 157 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 158 | 159 | \usepackage{minted} 160 | \definecolor{codeBg}{HTML}{FFFDE7} 161 | \setminted{ 162 | %style=pastie, 163 | frame=lines, 164 | framesep=3mm, 165 | linenos, 166 | breaklines=true, 167 | encoding=utf8, 168 | fontsize=\footnotesize, 169 | bgcolor=codeBg 170 | } 171 | 172 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 173 | %% CUSTOM COMMANDS 174 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 175 | 176 | % empty whitepage without numbering 177 | \newcommand{\whitepage}{ 178 | \clearpage\thispagestyle{empty}\addtocounter{page}{-1} \newpage \clearpage 179 | } 180 | 181 | % Add command before appendix section for page numbering: A-1 182 | \newcommand{\appendixpagenumbering}{ 183 | \break 184 | \pagenumbering{arabic} 185 | \renewcommand{\thepage}{\thesection-\arabic{page}} 186 | } 187 | 188 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 189 | %% CUSTOM MATH OPERATORS (functions not in italic in math mode) 190 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 191 | 192 | %\DeclareMathOperator{\arcsec}{arcsec} 193 | %\DeclareMathOperator{\arccot}{arccot} 194 | %\DeclareMathOperator{\arccsc}{arccsc} 195 | %\DeclareMathOperator{\cis}{cis} 196 | 197 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 198 | %% MISC 199 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 200 | 201 | %\usepackage{datetime} % Customize date 202 | %% \monthyeardate\today gives the date without the day 203 | %\newdateformat{monthyeardate}{% 204 | %\monthname[\THEMONTH], \THEYEAR} 205 | --------------------------------------------------------------------------------