-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstile.tex
345 lines (277 loc) · 11.4 KB
/
stile.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Template Dispense
%
% Autore:
% Teo Bucci
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% FONTS
%----------------------------------------------------------------------------------------
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage{dsfont} % per funzione indicatrice
%----------------------------------------------------------------------------------------
% VARIOUS REQUIRED PACKAGES AND CONFIGURATIONS
%----------------------------------------------------------------------------------------
\usepackage[italian]{babel} % Italian language/hyphenation
\usepackage{latexsym}
%\usepackage{amsmath,amsfonts,amssymb,amsthm} % For math equations, theorems, symbols, etc
%----------------------------------------------------------------------------------------
% FIGURE MATHCHA
%----------------------------------------------------------------------------------------
\usepackage{amsmath}
%\usepackage[fleqn]{amsmath} % per avere l'allineamento a sinistra delle equazioni
\usepackage{amssymb} % carica anche \usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{tikz}
\usepackage{mathdots}
\usepackage{cancel}
\usepackage{color}
\usepackage{siunitx}
\usepackage{array}
\usepackage{multirow}
%\usepackage{gensymb} % The gensymb package provides a number of ‘generic’ macros, which produce the same output in text and math mode: \degree \celsius \perthousand \ohm \micro
\usepackage{makecell}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{caption}\captionsetup{belowskip=12pt,aboveskip=4pt}
\usepackage{subcaption}
\usetikzlibrary{fadings}
\usetikzlibrary{patterns}
\usetikzlibrary{shadows.blur}
\usepackage{placeins} % The placeins package gives the command \FloatBarrier, which will make sure any floats will be put in before this point
\usepackage{flafter} % The flafter package ensures that floats don't appear until after they appear in the code.
\usepackage{bigints}
\usepackage{needspace}
%----------------------------------------------------------------------------------------
% INCLUSIONE FIGURE
%----------------------------------------------------------------------------------------
\usepackage{import}
\usepackage{pdfpages}
\usepackage{transparent}
\usepackage{xcolor}
\usepackage{graphicx}
\graphicspath{ {./images/} } % Path relative to the main .tex file
\usepackage{float}
\newcommand{\fg}[3][\relax]{%
\begin{figure}[htpb]%
\centering
\captionsetup{width=\textwidth}
\includegraphics[width = #2\textwidth]{#3}%
\ifx\relax#1\else\caption{#1}\fi
\label{#3}
\end{figure}%
}
%----------------------------------------------------------------------------------------
% PARAGRAFI, INTERLINEA E MARGINE
%----------------------------------------------------------------------------------------
\usepackage[none]{hyphenat} % Per non far andare a capo le parole con il trattino
\emergencystretch 3em % Per evitare che il testo vada oltre i margini
% \parindent 0ex % TOGLIE INTENDAMENTO PARAGRAFI, E' INCLUSO NEL PACCHETTO \parskip
% \setlength{\parindent}{4em} % VARIANTE DI QUELLO SOPRA
% \setlength{\parskip}{\baselineskip} % CAMBIA SPAZIO TRA PARAGRAFI (POSSO METTERE ANCHE 1em) INCLUSA LA TABLE OF CONTENTS, PERTANTO USO IL COMANDO CHE SEGUE
\usepackage[skip=0.2\baselineskip+2pt]{parskip}
% \renewcommand{\baselinestretch}{1.5} % CAMBIA INTERLINEA
%----------------------------------------------------------------------------------------
% HEADERS AND FOOTERS
%----------------------------------------------------------------------------------------
\usepackage{fancyhdr}
\pagestyle{empty} % Il fancy serve a partire al primo capitolo
\fancyhead{} % Pulisci header
\fancyfoot{} % Pulisci footer
\fancyhead[RE]{\nouppercase{\leftmark}}
%\fancyhead[LO]{\emph{Trascrizioni di Teo Bucci}}
\fancyhead[LO]{\nouppercase{\rightmark}}
\fancyhead[LE,RO]{\thepage}
% Removes the header from odd empty pages at the end of chapters
\makeatletter
\renewcommand{\cleardoublepage}{
\clearpage\ifodd\c@page\else
\hbox{}
\vspace*{\fill}
\thispagestyle{empty}
\newpage
\fi}
%----------------------------------------------------------------------------------------
% COMANDI PERSONALIZZATI
%----------------------------------------------------------------------------------------
\newcommand{\myNewEmptyPage}{\newpage $ $}
\newcommand{\sgn}{\mathop{\mathrm{sgn}}} % segno di funzione
%\renewcommand{\epsilon}{\varepsilon}
%\renewcommand{\theta}{\vartheta}
%\renewcommand{\rho}{\varrho}
%\renewcommand{\phi}{\varphi}
\newcommand{\degree}{^\circ\text{C}} % SIMBOLO GRADI
\newcommand{\notimplies}{\mathrel{{\ooalign{\hidewidth$\not\phantom{=}$\hidewidth\cr$\implies$}}}}
\renewcommand{\qed}{\tag*{$\blacksquare$}}
\newcommand{\latex}{\LaTeX\xspace}
\newcommand{\tex}{\TeX\xspace}
\newcommand{\questeq}{\overset{?}{=}} % è vero che?
\renewcommand{\leqslant}{\leq}
\renewcommand{\geqslant}{\geq}
\newcommand{\complementary}{^{\mathrm{C}}}
\renewcommand{\emptyset}{\varnothing} % simbolo insieme vuoto
\newcommand{\Bot}{\perp \!\!\! \perp} % indipendenza
\newcommand{\boxedText}[1]{\noindent\fbox{\parbox{\textwidth}{#1}}}
\usepackage{mathtools} % Serve per i due comandi dopo
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert} % CREA UN COMANDO abs()
\DeclarePairedDelimiter{\norma}{\lVert}{\rVert} % CREA UN COMANDO norma()
%----------------------------------------------------------------------------------------
% INDICE INIZIALE
%----------------------------------------------------------------------------------------
\setcounter{secnumdepth}{3} % DI DEFAULT LE SUBSUBSECTION NON SONO NUMERATE, COSÌ SÌ
\setcounter{tocdepth}{2} % FISSA LA PROFONDITÀ DELLE COSE MOSTRATE NELL'INDICE
\usepackage[hidelinks]{hyperref} % Rende l'indice interattivo e hidelinks nasconde il bordo rosso dai riferimenti
\newcommand{\nocontentsline}[3]{} % QUESTO COMANDO E QUELLO DOPO SERVONO PER AVERE IL COMANDO \tocless DA METTERE PRIMA DI UNA SEZIONE CHE NON VOGLIO FAR APPARIRE NELL'INDICE
\newcommand{\tocless}[2]{\bgroup\let\addcontentsline=\nocontentsline#1{#2}\egroup}
%----------------------------------------------------------------------------------------
% APPENDICE
%----------------------------------------------------------------------------------------
\usepackage[toc,page]{appendix}
%----------------------------------------------------------------------------------------
% SIMBOLI CARTE DA GIOCO
%
% Sono i seguenti:
% \varheartsuit
% \vardiamondsuit
% \clubsuit
% \spadesuit
%----------------------------------------------------------------------------------------
\DeclareSymbolFont{extraup}{U}{zavm}{m}{n}
\DeclareMathSymbol{\varheartsuit}{\mathalpha}{extraup}{86}
\DeclareMathSymbol{\vardiamondsuit}{\mathalpha}{extraup}{87}
%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
%%%% TESTING
\definecolor{grey}{RGB}{245,245,245}
\newtheoremstyle{blacknumbox} % Theorem style name
{0pt}% Space above
{0pt}% Space below
{\normalfont}% Body font
{}% Indent amount
{\bf\scshape}% Theorem head font --- {\small\bf}
{.\;}% Punctuation after theorem head
{0.25em}% Space after theorem head
{\small\thmname{#1}\nobreakspace\thmnumber{\@ifnotempty{#1}{}\@upn{#2}}% Theorem text (e.g. Theorem 2.1)
%{\small\thmname{#1}% Theorem text (e.g. Theorem)
\thmnote{\nobreakspace\the\thm@notefont\normalfont\bfseries---\nobreakspace#3}}% Optional theorem note
\newcounter{dummy}
\numberwithin{dummy}{chapter}
\theoremstyle{blacknumbox}
\newtheorem{definitionT}[dummy]{Definizione}
\newtheorem{NBT}[dummy]{NB}
\newtheorem{theoremT}[dummy]{Teorema}
\newtheorem{ossT}[dummy]{Osservazione}
\newtheorem{ricalgT}[dummy]{Richiamo di Algebra}
\newtheorem{pseudocodiceT}[dummy]{Pseudocodice}
\newtheorem{corollarioT}[dummy]{Corollario}
\newtheorem{lemmaT}[dummy]{Lemma}
\newtheorem{dimT}[dummy]{Dimostrazione}
\RequirePackage[framemethod=default]{mdframed} % Required for creating the theorem, definition, exercise and corollary boxes
\usepackage{lipsum}
% orange box
\newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=orange,
backgroundcolor=orange!5,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=5pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=2pt,
innerbottommargin=5pt]{oBox}
% green box
\newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=green,
backgroundcolor=green!5,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=5pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=2pt,
innerbottommargin=5pt]{gBox}
% blue box
\newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=blue,
backgroundcolor=blue!5,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=5pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=2pt,
innerbottommargin=5pt]{bBox}
% b&w box
\newmdenv[skipabove=7pt,
skipbelow=7pt,
rightline=false,
leftline=true,
topline=false,
bottomline=false,
linecolor=black,
%backgroundcolor=grey!70,
innerleftmargin=5pt,
innerrightmargin=5pt,
innertopmargin=5pt,
leftmargin=0cm,
rightmargin=0cm,
linewidth=2pt,
innerbottommargin=5pt]{bwBox}
\newenvironment{theorem}{\begin{bwBox}\begin{theoremT}}{\end{theoremT}\end{bwBox}}
\newenvironment{definition}{\begin{bwBox}\begin{definitionT}}{\end{definitionT}\end{bwBox}}
\newenvironment{nb}{\begin{bwBox}\begin{NBT}}{\end{NBT}\end{bwBox}}
\newenvironment{oss}{\begin{bwBox}\begin{ossT}}{\end{ossT}\end{bwBox}}
\newenvironment{ricalg}{\begin{bwBox}\begin{ricalgT}}{\end{ricalgT}\end{bwBox}}
\newenvironment{pseudocode}{\begin{bwBox}\begin{pseudocodiceT}}{\end{pseudocodiceT}\end{bwBox}}
\newenvironment{corollario}{\begin{bwBox}\begin{corollarioT}}{\end{corollarioT}\end{bwBox}}
\newenvironment{lemma}{\begin{bwBox}\begin{lemmaT}}{\end{lemmaT}\end{bwBox}}
\newenvironment{dimostrazione}{\begin{bwBox}\begin{dimT}}{\[\qed\]\end{dimT}\end{bwBox}}
\newenvironment{algo}{
\begin{bwBox}
\begin{algorithm}[H]
}{
\end{algorithm}
\end{bwBox}
}
% pseudocodici
\usepackage[linesnumbered,ruled,italiano]{algorithm2e}
\DontPrintSemicolon
\setlength{\algomargin}{0.5cm}
% per azzerare le linee di "ruled", lo faccio così la caption sta a sinistra in alto
\setlength{\algoheightrule}{0pt}
\setlength{\algotitleheightrule}{0pt}
% per lo stile del titolo "Algoritmo X:..." uniforme agli altri box
\SetAlCapFnt{\bf\scshape}
%% comandi pratici
% d nell'integrale
\newcommand{\de}{\mathrm d}
\newcommand{\dx}{\de x}
\newcommand{\dy}{\de y}
\newcommand{\ds}{\de s}
\newcommand{\dt}{\de t}
\newcommand{\textqed}{\hfill$\blacksquare$}