1 % \documentclass[14pt]{extarticle} 2 3 % page setup 4 \usepackage[a4paper, 5 top=2.75cm, 6 bottom=2.50cm, 7 left=2.25cm, 8 right=2.25cm, 9 bmargin=2.50cm]{geometry} 10 11 \usepackage{titlesec} 12 \usepackage{fontspec} 13 14 % right pointing hand 15 \usepackage{utfsym} 16 17 % make pictures caption font bold and small 18 \usepackage[font={footnotesize}]{caption} 19 20 % inline code (backticks in md) 21 \linespread{1.10} 22 % \definecolor{bgcolor}{HTML}{e0e0e0} 23 \definecolor{bgcolor}{HTML}{f9f9f9} 24 \let\oldtexttt\texttt 25 26 \renewcommand{\texttt}[1]{ 27 \setlength\fboxsep{2pt} 28 \kern-0.60em\colorbox{bgcolor}{\oldtexttt{#1}}\kern-0.25pt 29 } 30 31 % change boldfont bold to extrabold 32 % \setmainfont[ 33 % BoldFont={Inter-ExtraBold} 34 % ]{Inter} 35 36 % change regular font to light font 37 % \setmainfont{Inter light} 38 % \setmainfont{Inter} 39 \setmainfont{Nimbus Sans} 40 % \setmainfont{Nimbus Sans L} 41 42 \newfontfamily\titlefont{Inter}[ 43 UprightFont = *-Regular, 44 BoldFont = *-ExtraBold, 45 Scale = 1.0 46 ] 47 48 \newfontfamily\sectionsfont{Inter}[ 49 UprightFont = *-Regular, 50 BoldFont = *-Bold, 51 ] 52 53 \setmathfont{Fira Math} 54 55 \usepackage{xcolor} 56 \definecolor{ugrey}{HTML}{333333} 57 58 \titleformat{\section} 59 {\color{ugrey}\titlefont\LARGE\bfseries} 60 {\color{ugrey}} 61 {0em} 62 {} 63 64 \titleformat{\subsection} 65 {\color{ugrey}\sectionsfont\Large\bfseries} 66 {\color{ugrey}} 67 {0em} 68 {} 69 70 \titleformat{\subsubsection} 71 {\color{ugrey}\sectionsfont\large\bfseries} 72 {\color{ugrey}} 73 {0em} 74 {} 75 76 \titleformat{\paragraph} 77 {\color{ugrey}\sectionsfont\bfseries} 78 {\color{ugrey}\theparagraph} 79 {0em} 80 {} 81 82 \titleformat{\subparagraph} 83 {\color{ugrey}\normalfont\bfseries} 84 {\color{ugrey}\theparagraph} 85 {0em} 86 {} 87 88 % spacing: how to read {12pt plus 4pt minus 2pt} 89 % 12pt is what we would like the spacing to be 90 % plus 4pt means that TeX can stretch it by at most 4pt 91 % minus 2pt means that TeX can shrink it by at most 2pt 92 % 93 % \titlespacing{command}{left spacing}{before spacing}{after spacing}[right] 94 95 \titlespacing*{\section} 96 {0pt}{2ex plus 1ex minus .2ex}{1.75ex plus .2ex} 97 98 \titlespacing*{\subsection} 99 {0pt}{1.75ex plus 1ex minus .2ex}{1.5ex plus .2ex} 100 101 \titlespacing*{\subsubsection} 102 {0pt}{1.5ex plus 1ex minus .2ex}{1.25ex plus .2ex} 103 104 \titlespacing*{\paragraph} 105 {0pt}{1.5ex plus 1ex minus .2ex}{1.0ex plus .2ex} 106 107 \titlespacing*{\subparagraph} 108 {0pt}{1.25ex plus 1ex minus .2ex}{1.0ex plus .2ex} 109 110 % spacing between formulas and text 111 \setlength{\abovedisplayskip}{5pt} 112 \setlength{\belowdisplayskip}{2pt} 113 114 \setlength{\abovedisplayshortskip}{9pt} 115 \setlength{\belowdisplayshortskip}{2pt} 116 117 \setlength{\belowdisplayshortskip}{\belowdisplayskip} 118 119 \setlength{\baselineskip}{10pt} 120 121 % \usepackage{setspace} 122 % \setstretch{1.25} 123 124 % \renewcommand{\figurename}{Fig.} 125 126 \usepackage{caption} 127 \captionsetup{labelformat=empty} 128 129 % \renewcommand{\contentsname}{Índice} 130 \renewcommand\contentsname{\vspace*{-45pt}} 131 132 % TOC dots separation 133 % \renewcommand{\cftdotsep}{10} 134 135 % \setlength{\cftsecindent}{0pt}% Remove indent for \section 136 % \setlength{\cftsubsecindent}{5pt}% Remove indent for \subsection 137 % \setlength{\cftsubsubsecindent}{0pt}% Remove indent for \subsubsec 138 139 \setcounter{tocdepth}{4} 140 141 \usepackage{titling} 142 \renewcommand{\maketitle}{ 143 \begin{flushleft} 144 {\bfseries\Huge\thetitle} 145 \vspace{1mm} 146 \end{flushleft} 147 % \thispagestyle{empty} 148 } 149 150 % remove the page number from all the pages that the TOC occupies 151 \addtocontents{toc}{\protect\thispagestyle{empty}} 152 153 % add page break after TOC set it to page number 1 154 \let\oldtableofcontents\tableofcontents % remember the definition 155 \renewcommand\tableofcontents{ 156 \oldtableofcontents % use the standard toc 157 \thispagestyle{empty} 158 \pagebreak 159 \setcounter{page}{1} 160 } 161 162 % Set text color for all document 163 % \color{ugrey} 164 165 \usepackage[titles]{tocloft} 166 \renewcommand{\cftdotsep}{1.5} 167 \renewcommand{\cftsetpnumwidth}{1.5} 168 \renewcommand{\cftsetrmarg}{1.5} 169 170 \usepackage{float} 171 \makeatletter 172 \def\fps@figure{H} 173 \makeatother 174 175 % nicer chemical figures 176 \usepackage{chemfig} 177 178 % change style of quote, see also https://tex.stackexchange.com/a/436253/114857 179 \usepackage[most]{tcolorbox} 180 181 182 \definecolor{linequote}{RGB}{224,215,188} 183 \definecolor{bordercolor}{RGB}{221,221,221} 184 % \definecolor{backquote}{RGB}{249,245,233} 185 \definecolor{backquote}{RGB}{230,230,230} 186 187 % change left border: https://tex.stackexchange.com/a/475716/114857 188 % change left margin: https://tex.stackexchange.com/a/457936/114857 189 \newtcolorbox{myquote}[1][]{% 190 enhanced jigsaw, 191 % unbreakable, 192 breakable, 193 size=minimal, 194 left=10pt, 195 top=10pt, 196 bottom=10pt, 197 right=10pt, 198 boxrule=1pt, 199 sharp corners=all, 200 colback=bgcolor, 201 colframe=black, 202 segmentation style={ 203 bottomrule first=0pt, 204 toprule middle=0pt, 205 bottomrule middle=0pt, 206 toprule last=0pt, 207 }, 208 #1} 209 210 \usepackage{enumitem} 211 212 % redefine quote environment to use the myquote environment, see 213 % https://tex.stackexchange.com/a/337587/114857 214 % \renewenvironment{quote}{ 215 % \begin{myquote} 216 % \setlist[1]{leftmargin=11pt}} 217 % {\setlist[1]{leftmargin=!} 218 % \end{myquote}} 219 \renewenvironment{quote}{ 220 \begin{myquote} 221 \setlist[1]{leftmargin=12pt,rightmargin=12pt}} 222 {\setlist[1]{leftmargin=!} 223 \end{myquote}} 224 225 % better fractions 226 \usepackage{nicefrac,xfrac} 227 228 % surround footnotes number with square brackets and always use numbers (even 229 % inside quoted text) 230 % https://www.overleaf.com/learn/latex/Footnotes 231 \renewcommand*{\thefootnote}{\ [\arabic{footnote}]\ } 232 \renewcommand*{\thempfootnote}{\ [\arabic{mpfootnote}]\ } 233 234 % space between text and footer 235 \setlength\footskip{35pt} 236 \setlength{\skip\footins}{8pt} 237 238 % align first letter of all the lines in the footnotes 239 \usepackage[bottomfloats,belowfloats,hang]{footmisc} 240 \setlength{\footnotemargin}{1em} 241 242 \newcommand{\unit}[2]{\nicefrac{#1}{#2}} 243 244 \usepackage{amsfonts} 245 \usepackage{subcaption} 246 \usepackage{float} 247 \usepackage{tabularx} 248 249 \usepackage{bbding} % HandRight (install texlive-fontsextra)
