forked from Vashy/ASD-Notes
-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.tex
142 lines (122 loc) · 4.7 KB
/
config.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
\documentclass[12pt,a4paper]{article}
\usepackage[english,italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\hypersetup{
bookmarks=true, % show bookmarks bar?
% unicode=false, % non-Latin characters in Acrobat’s bookmarks
% pdftoolbar=true, % show Acrobat’s toolbar?
pdfmenubar=true, % show Acrobat’s menu?
% pdffitwindow=false, % window fit to page when opened
pdfstartview={FitH}, % fits the width of the page to the window
pdftitle={Appunti di Algoritmi e Strutture Dati}, % title
pdfauthor={Timoty Granziero, Marco Siragna}, % author
% pdfsubject={}, % subject of the document
% pdfcreator={Creator}, % creator of the document
% pdfproducer={Producer}, % producer of the document
% pdfkeywords={keyword1, key2, key3}, % list of keywords
% pdfnewwindow=true, % links in new PDF window
colorlinks=true, % false: boxed links; true: colored links
linkcolor=black, % color of internal links (change box color with linkbordercolor)
% citecolor=green, % color of links to bibliography
% filecolor=magenta, % color of file links
urlcolor=red!50!black % color of external links
}
\usepackage{graphicx} % img/media
% lists
\usepackage{enumitem}
\renewcommand{\labelitemi}{$\circ$}
\renewcommand{\labelitemii}{$\cdot$}
\renewcommand{\labelitemiii}{$\diamond$}
\renewcommand{\labelitemiv}{$\ast$}
\usepackage[perpage]{footmisc} % footnote, starting at 1 every page
\usepackage{mathtools,stmaryrd} % math package
\usepackage{amssymb} % N, R ... symbols
\usepackage{blkarray} % block arrays
\usepackage{cancel} % diagonal lines to cancel terms in math
\usepackage{textcomp} % quotes
\usepackage{totpages}
\let\emph\relax % there's no \RedeclareTextFontCommand
\DeclareTextFontCommand{\emph}{\bfseries} %emph to textbf
% floor and ceil
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
% abs and norm
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\DeclarePairedDelimiter\norm{\lVert}{\rVert}
% Swap the definition of \abs* and \norm*, so that \abs
% and \norm resizes the size of the brackets, and the
% starred version does not.
\makeatletter
\let\oldabs\abs
\def\abs{\@ifstar{\oldabs}{\oldabs*}}
\let\oldnorm\norm
\def\norm{\@ifstar{\oldnorm}{\oldnorm*}}
\makeatother
% add spacing after exists and forall
\let\existstemp\exists
\let\nexiststemp\nexists
\let\foralltemp\forall
\renewcommand{\exists}{\existstemp~}
\renewcommand{\nexists}{\nexiststemp~}
\renewcommand{\forall}{\foralltemp~}
\newcommand{\angleset}[1]{\langle #1 \rangle} % faster string representation as a set of characters
% algorithms pseudocode
\usepackage{clrscode3e}
\renewcommand{\ElseIf}{\kill\addtocounter{indent}{-1}\liprint\textbf{else if} }
\renewcommand{\Downto}{\ifmmode\ \textrm{\textbf{down to}}\ \else\textbf{down to}\ \fi}
\renewcommand{\And}{\ifmmode\ \textrm{\textbf{and}}\ \else\textbf{and}\ \fi}
\newcommand{\Or}{\ifmmode\ \textrm{\textbf{or}}\ \else\textbf{or}\ \fi}
\RequirePackage{graphics} % needed for \scalebox command
% drawing and trees
\usepackage{tikz}
\usepackage{tikz-qtree}
\usetikzlibrary{calc,positioning,arrows.meta}
\tikzset{
rec/.style={
every node/.style={align=center},
edge from parent/.style={draw},
no edge from this parent/.style={every child/.append style={edge from parent/.style={draw=none}}},
level 3/.style={level distance=20mm},
level 4/.style={level distance=5mm},
level/.style={level distance=25mm, sibling distance=40mm/##1}
},
tree/.style={
every tree node/.style={minimum size=10mm,black},
edge from parent/.style={draw,edge from parent path={(\tikzparentnode) -- (\tikzchildnode)}},
sibling distance=8mm,
level distance=18mm
},
red/.style={draw=none},
black/.style={draw,circle},
unknown/.style={dashed},
unknown2/.style={dotted},
blank/.style={draw=none},
% double circle macro
old inner xsep/.estore in=\oldinnerxsep,
old inner ysep/.estore in=\oldinnerysep,
double circle/.style 2 args={
circle,
old inner xsep=\pgfkeysvalueof{/pgf/inner xsep},
old inner ysep=\pgfkeysvalueof{/pgf/inner ysep},
/pgf/inner xsep=\oldinnerxsep+#1,
/pgf/inner ysep=\oldinnerysep+#1,
alias=sourcenode,
append after command={
let \p1=(sourcenode.center),
\p2=(sourcenode.east),
\n1={\x2-\x1-#1-0.5*\pgflinewidth}
in node[inner sep=0pt,draw,circle,minimum width=2*\n1,at=(\p1),#2]{}
}
},
double circle/.default={4pt}{black}
}
\usepackage{fancyhdr} % header and footer
% header/footer setup
\fancyhf{}
\fancyhead[R]{\small\scshape\nouppercase{\leftmark}}
\fancyhead[L]{\small\scshape\nouppercase{\rightmark}}
\lhead{\nouppercase{\rightmark}}
\rhead{\nouppercase{\leftmark}}
\cfoot{\thepage}
\pagestyle{fancy}