TB067

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