Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Bold symbols
- \usepackage{bold-extra}
- \usepackage{bm}
- % Parskip to have paragraphs with the right spacing and keep indentation
- \edef\restoreparindent{\parindent=\the\parindent\relax}
- \usepackage{parskip}
- \restoreparindent
- % ROBOTO!
- \usepackage[sfdefault]{roboto}
- % Italian language support
- \usepackage[T1]{fontenc}
- \usepackage[italian]{babel} % Italian support
- \usepackage[utf8]{inputenc} % Accented letters
- % Misc
- %\usepackage[medium]{titlesec} % Smaller section's font
- \usepackage{indentfirst}
- \usepackage{textcomp} % To have \textcelsius and other symbols
- % To have better rules in tables
- \usepackage{bookmark}
- \usepackage{multirow}
- % To fix margins that overflow
- %\usepackage{marginfix}
- %\usepackage[all]{hypcap} % To fix caption loading of hyperref
- \usepackage{hyperref}
- % Mathematsics and Physics
- \usepackage{amsmath,amsfonts,amssymb,mathtools,mathrsfs}
- \usepackage{physics}
- % Theorems
- \usepackage[framed,amsthm,hyperref,thmmarks,amsmath]{ntheorem}
- \usepackage{framed,mdframed}
- % After hyperref and amsmath
- \usepackage[capitalize,noabbrev,nameinlink,italian]{cleveref}
- \usepackage{cancel}
- \usepackage{booktabs,xtab,tabulary}
- %%%% MAIN COLORS %%%%%
- \definecolor{theorem1}{HTML}{ff8f00}
- \definecolor{theorem2}{HTML}{ffca28}
- \definecolor{def1}{HTML}{2e7d32}
- \definecolor{def2}{HTML}{66bb6a}
- \definecolor{ex1}{HTML}{1565c0}
- \definecolor{ex2}{HTML}{42a5f5}
- %%%%%%%
- %%%% Sections styles %%%%%
- \usepackage{titlesec,titletoc}
- \setcounter{secnumdepth}{2}
- % chapter format
- \titleformat{\chapter}%
- {\huge\rmfamily\itshape\color{def1}}% format applied to label+text
- {\llap{\colorbox{def1}{\parbox{1.5cm}{\hfill\itshape\huge\color{white}\thechapter}}}}% label
- {2pt}% horizontal separation between label and title body
- {}% before the title body
- %{\titlerule*[0.7em]{.}\rmfamily\upshape\thechapter} % filler + page (leaders and page num)
- []% after the title body
- % section format
- \titleformat{\section}%
- {\normalfont\Large\itshape\color{theorem1}}% format applied to label+text
- {\llap{\colorbox{theorem1}{\parbox{1.5cm}{\hfill\color{white}\thesection}}}}% label
- {1em}% horizontal separation between label and title body
- {}% beforethe title body
- []% after the title body
- % subsectionformat
- \titleformat{\subsection}%
- {\normalfont\large\itshape\color{ex1}}% format applied to label+text
- {\llap{\colorbox{ex1}{\parbox{1.5cm}{\hfill\color{white}\thesubsection}}}}% label
- {1em}% horizontal separation between label and title body
- {}% beforethe title body
- []% after the title body
- %%%% TOC CHANGES %%%%
- \titlecontents{chapter}%
- [-4em] % distance from left margin
- {\fontsize{15}{25}\itshape\bfseries} % above (global formatting of entry)
- {\hspace*{2em}\textcolor{def1}{\contentslabel{2em}}} % before w/label (label = ``2.6'')
- {\hspace*{2em}} % before w/o label
- {\titlerule*[0.7em]{.}\rmfamily\upshape\contentspage} % filler + page (leaders and page num)
- [] % after
- \titlecontents{section}%
- [0em] % distance from left margin
- {\fontsize{11}{15}\itshape} % above (global formatting of entry)
- {\hspace*{2em}\textcolor{theorem1}{\contentslabel{2em}}} % before w/label (label = ``2.6'')
- {\hspace*{2em}} % before w/o label
- {\titlerule*[0.7em]{.}\rmfamily\upshape\contentspage} % filler + page (leaders and page num)
- [] % after
- %%%% TIKZ %%%%
- \usepackage{tikz}
- \usepackage{pgfplots}
- \pgfplotsset{compat=1.14}
- \usepgfplotslibrary{%
- fillbetween,
- external,
- polar
- }
- \tikzsetexternalprefix{tikz_figures/}
- %\tikzexternalize
- \usetikzlibrary{%
- arrows,
- decorations,
- decorations.pathmorphing,
- decorations.markings,
- calc,
- intersections,
- matrix,
- spy,
- shapes.geometric,
- shapes.misc,
- patterns,
- math,
- cd,
- }
- \usepackage{tikz-3dplot}
- % axis style, ticks, etc
- \pgfplotsset{every axis/.append style={%
- %axis lines=middle, % put the axis in the middle
- %axis line style={->}, % arrows on the axis
- xlabel={$x$}, % default put x on x-axis
- ylabel={$y$}, % default put y on y-axis
- zlabel={$z$}, % default put z on z-axis
- %axis equal, % 1:1 ratio
- %grid=both, % coordinate grid
- %grid style={line width=.1pt, draw=gray!10},
- %major grid style={line width=.2pt,draw=gray!50},
- ticks=both, % ticks for integers
- minor tick num=5, % number of subticks
- %ticklabel style={font=\small,fill=white},
- %xlabel style={at={(ticklabel* cs:1)},anchor=north west},
- %ylabel style={at={(ticklabel* cs:1)},anchor=south west},
- %zlabel style={at={(ticklabel* cs:1)},anchor= west},
- }
- }
- \pgfplotsset{2dstyle/.style={
- axis lines=middle, % put the axis in the middle
- axis line style={->}, % arrows on the axis
- xlabel={$x$}, % default put x on x-axis
- ylabel={$y$}, % default put y on y-axis
- zlabel={$z$}, % default put z on z-axis
- axis equal, % 1:1 ratio
- grid=both, % coordinate grid
- grid style={line width=.1pt, draw=gray!10},
- major grid style={line width=.2pt,draw=gray!50},
- ticks=both, % ticks for integers
- minor tick num=5, % number of subticks
- ticklabel style={font=\small,fill=white},
- label style={at={(ticklabel* cs:1)},anchor=north west},
- ylabel style={at={(ticklabel* cs:1)},anchor=south west},
- zlabel style={at={(ticklabel* cs:1)},anchor= west},
- }
- }
- \tikzset{>=stealth}
- %% New tikzcd environment so that it can be used inside a picture %%
- \usepackage{environ}
- % activate the following such that you can check the macro expansion in
- % *-figure0.md5 manually
- %\tikzset{external/up to date check=diff}
- \def\temp{&} \catcode`&=\active \let&=\temp
- \newcommand{\mytikzcdcontext}[2]{
- \begin{tikzpicture}[baseline=(maintikzcdnode.base)]
- \node (maintikzcdnode) [inner sep=0, outer sep=0] {\begin{tikzcd}[#2]
- #1
- \end{tikzcd}};
- \end{tikzpicture}}
- \NewEnviron{tikz-cd}[1][]{%
- % In the following, we need \BODY to expanded before \mytikzcdcontext
- % such that the md5 function gets the tikzcd content with \BODY expanded.
- % Howerver, expand it only once, because the \tikz-macros aren't
- % defined at this point yet. The same thing holds for the arguments to
- % the tikzcd-environment.
- \def\myargs{#1}%
- \edef\mydiagram{\noexpand\mytikzcdcontext{\expandonce\BODY}{\expandonce\myargs}}%
- \mydiagram%
- }
- \tikzset{%
- double line with arrow/.style args={#1,#2}{%
- decorate,decoration={%
- markings,
- mark=at position 0 with {%
- \coordinate (ta-base-1) at (0,1pt);
- \coordinate (ta-base-2) at (0,-1pt);
- },%
- mark=at position 1 with {%
- \draw[#1] (ta-base-1) -- (0,1pt);
- \draw[#2] (ta-base-2) -- (0,-1pt);
- }
- }
- },
- Equal/.style={-,double line with arrow={-,-}}
- }
- %%%% GENERAL COMMANDS %%%%
- % Disjoint union
- \newcommand{\cupdot}{\charfusion[\mathbin]{\cup}{\cdot}}
- \newcommand{\bigcupdot}{\charfusion[\mathop]{\bigcup}{\cdot}}
- % A rotated \in
- \newcommand{\vin}{\mathbin{\text{\rotatebox[origin=c]{90}{$\in$}}}}
- % Complex conjugate
- \newcommand{\conj}[1]{\overline{#1}}
- % cos # + i sin #1
- %\newcommand{\cis}[1]{\cos\left(#1\right)+i\sin\left(#1\right)}
- \makeatletter
- \def\cis{\@ifnextchar[{\@withcis}{\@withoutcis}}
- \def\@withcis[#1]#2{%
- \cos\left(#2\right)-i\sin\left(#2\right)
- }
- \def\@withoutcis#1{%
- \cos\left(#1\right)+i\sin\left(#1\right)
- }
- \makeatother
- % Equivalence classes
- \newcommand{\class}[1]{\left[#1\right]}
- % Such that both in and outside sets
- \newcommand{\Setsuchthat}{\;\ifnum\currentgrouptype=16 \middle\fi|\;}
- \newcommand{\suchthat}{\,:}
- % New command for nested fractions
- \everymath{\displaystyle}
- \newcommand\ddfrac[2]{\frac{\displaystyle #1}{\displaystyle #2}}
- % Definition equivalnce
- \newcommand{\bydef}{\overset{\text{def}}{=}}
- % Successions
- \newcommand{\suc}[2]{{\{#1\}}_{#2}}
- % Replace the empty set symbol
- \let\oldemptyset\emptyset
- \let\emptyset\varnothing
- % Negation of the implication
- \newcommand{\notimplies}{%
- \mathrel{{\ooalign{\hidewidth$\not\phantom{=}$\hidewidth\cr$\implies$}}}}
- % Change vector appearance
- \renewcommand{\vec}[1]{\mathbf{#1}}
- % Directional derivative
- \newcommand{\ddv}[3][]{\ensuremath{\mathrm{D}^{#1}_{#2}#3}}
- % Linear combination
- \newcommand{\lin}[1]{\ensuremath{\mathscr{L}\!\left(#1\right)}}
- % Scalar product
- \newcommand{\scalar}[2]{\ensuremath{\left\langle #1,\,#2 \right\rangle}}
- % Matrix transpose
- \newcommand{\transp}{^\intercal}
- % GL/SL/O/SO/U/SU
- \newcommand{\GL}[2]{\ensuremath{\mathrm{GL}\left( #1,\,#2 \right)}}
- \newcommand{\SL}[2]{\ensuremath{\mathrm{SL}\left(#1,\,#2\right)}}
- \newcommand{\Om}[1]{\ensuremath{\mathrm{O}\left(#1\right)}}
- \newcommand{\SO}[1]{\ensuremath{\mathrm{SO}\left(#1\right)}}
- \newcommand{\Um}[1]{\ensuremath{\mathrm{U}\left(#1\right)}}
- \newcommand{\SU}[1]{\ensuremath{\mathrm{SU}\left(#1\right)}}
- % R, C, N, Z
- \newcommand\N{\ensuremath{\mathbb{N}}}
- \newcommand\R{\ensuremath{\mathbb{R}}}
- \newcommand\Z{\ensuremath{\mathbb{Z}}}
- \renewcommand\O{\ensuremath{\emptyset}}
- \newcommand\Q{\ensuremath{\mathbb{Q}}}
- \renewcommand\C{\ensuremath{\mathbb{C}}}
- \newcommand\K{\ensuremath{\mathbb{K}}}
- % Continuous functions
- \newcommand{\cont}[3][]{\ensuremath{\mathcal{C}^{#1}\!\left(#2;\,#3\right)}}
- % Ball
- \newcommand{\ball}[3][]{\ensuremath{\mathcal{B}_{#1}\!\left(#2,\,#3\right)}}
- % Closure
- \newcommand{\closure}[2][3]{{}\mkern#1mu\overline{\mkern-#1mu#2}}
- % Inside
- \newcommand{\inside}[1]{\ensuremath{{#1}^\circ}}
- % Quotient
- \newcommand{\quot}[2]{\ensuremath{\flatfrac{#1}{#2}}}
- % Function restriction
- \newcommand\restr[2]{{% we make the whole thing an ordinary symbol
- \left.\kern-\nulldelimiterspace % automatically resize the bar with \right
- #1 % the function
- \vphantom{\big|} % pretend it's a little taller at normal size
- \right|_{#2} % this is the delimiter
- }}
- % Divides
- \makeatletter
- \def\localbig#1#2{%
- \sbox\z@{$\m@th#1
- \sbox\tw@{$#1()$}%
- \dimen@=\ht\tw@\advance\dimen@\dp\tw@
- \nulldelimiterspace\z@\left#2\vcenter to1.2\dimen@{}\right.
- $}\box\z@}
- \newcommand{\divides}{\mathrel{\mathpalette\dividesaux\relax}}
- \newcommand{\ndivides}{\mathrel{\mathpalette\ndividesaux\relax}}
- \newcommand{\dividesaux}[2]{\mbox{$\m@th#1\localbig{#1}|$}}
- \newcommand{\ndividesaux}[2]{%
- \mkern.5mu
- \ooalign{%
- \hidewidth$\m@th#1\localbig{#1}|$\hidewidth\cr
- $\m@th#1\nmid$\cr%
- }%
- }
- \makeatother
- %%%% END GENERAL COMMANDS %%%%
- %%%% MATH OPERATORS %%%%
- % Set image
- \DeclareMathOperator{\im}{im}
- % Identity function
- \DeclareMathOperator{\id}{id}
- % lcm
- \DeclareMathOperator{\mcm}{mcm}
- % Complex argument
- \DeclareMathOperator{\Arg}{Arg}
- % Sign of a function
- \DeclareMathOperator{\sgn}{sgn}
- % Degree of a polynomial
- \DeclareMathOperator{\degr}{deg}
- % Symmetric group
- \DeclareMathOperator{\Sym}{Sym}
- % Adjoint
- \DeclareMathOperator{\adj}{adj}
- \renewcommand\qedsymbol{$\blacksquare$}
- % Theorems, Definitions and Examples
- \usepackage[theorems,skins,breakable,listings]{tcolorbox}
- \definecolor{theorem1}{HTML}{ff8f00}
- \definecolor{theorem2}{HTML}{ffca28}
- \definecolor{def1}{HTML}{2e7d32}
- \definecolor{def2}{HTML}{66bb6a}
- \definecolor{ex1}{HTML}{1565c0}
- \definecolor{ex2}{HTML}{42a5f5}
- \tcbset{
- %defstyle/.style={
- % breakable,
- % theorem style=break,
- % enhanced,
- % colframe=green!50!black,
- % colback=OliveGreen!10!white,
- % coltitle=OliveGreen!90!black,
- % fonttitle=\bfseries,
- % fontupper=\upshape,
- % fuzzy shadow={0.5mm}{-0.5mm}{0mm}{0.1mm}{fill=green!50!black!50!white},
- % boxrule=0.4pt
- %},
- defstyle/.style={
- breakable,
- theorem style=plain apart,
- enhanced,
- sharp corners,
- frame hidden,
- colbacktitle=def1,
- colback=def2!50!white,
- coltitle=white,
- boxrule=0pt,
- titlerule=1mm,
- titlerule style=def1!50!black,
- fonttitle=\upshape\bfseries,
- fontupper=\upshape,
- boxrule=0.4pt,
- halign=left
- },
- %exstyle/.style={
- % breakable,
- % theorem style=break,
- % enhanced,
- % colframe=blue!50!black,
- % colback=NavyBlue!10!white,
- % coltitle=NavyBlue,
- % fonttitle=\upshape\bfseries,
- % fontupper=\upshape,
- % fuzzy shadow={0.5mm}{-0.5mm}{0mm}{0.1mm}{fill=blue!50!black!50!white},
- % boxrule=0.4pt
- % },
- exstyle/.style={
- breakable,
- theorem style=plain apart,
- enhanced,
- sharp corners,
- frame hidden,
- colbacktitle=ex1,
- colback=ex2!50!white,
- coltitle=white,
- boxrule=0pt,
- titlerule=1mm,
- titlerule style=ex1!50!black,
- fonttitle=\upshape\bfseries,
- fontupper=\upshape,
- boxrule=0.4pt,
- halign=left
- },
- %thmstyle/.style={
- % breakable,
- % theorem style=break,
- % enhanced,
- % colframe=red!50!black,
- % colback=BrickRed!10!white,
- % coltitle=BrickRed,
- % fonttitle=\upshape\bfseries,
- % fontupper=\itshape,
- % fuzzy shadow={0.5mm}{-0.5mm}{0mm}{0.1mm}{fill=red!50!black!50!white},
- % boxrule=0.4pt
- %},
- thmstyle/.style={
- breakable,
- theorem style=plain apart,
- enhanced,
- sharp corners,
- frame hidden,
- colbacktitle=theorem1,
- colback=theorem2!50!white,
- coltitle=white,
- boxrule=0pt,
- titlerule=1mm,
- titlerule style=theorem1!50!black,
- fonttitle=\upshape\bfseries,
- fontupper=\itshape,
- boxrule=0.4pt,
- halign=left
- },
- proofstyle/.style={
- breakable,
- enhanced,
- theorem style=plain,
- frame hidden,
- sharp corners,
- colback=gray!15!white,
- boxrule=0pt,
- before skip=10pt,
- after skip=10pt,
- borderline west={1mm}{0pt}{darkgray},
- fonttitle=\bfseries,
- coltitle=black,
- title=Dimostrazione,
- halign=left
- }
- }
- % This allows for the skins library to not be externalized by Tikz, removing problems
- \tcbset{shield externalize}
- \makeatletter
- % add tcblistings to \jobname.lol (list of listings)
- \tcbset{
- addtolol/.style={list entry={\kvtcb@title},add to list={lol}{subsection}},
- }
- \makeatother
- \newtcbtheorem[crefname={teorema}{teoremi},Crefname={Teorema}{Teoremi},list
- inside=thm,number within=chapter]{Thm}{Teorema}{thmstyle}{thm}
- \newtcbtheorem{Proof}{Dimostrazione}{proofstyle}{}
- \newtcbtheorem[crefname={esempio}{esempi},Crefname={Esempio}{Esempi},list
- inside=ex,number within=chapter]{Ex}{Esempio}{exstyle}{ex}
- \newtcbtheorem[crefname={definizione}{definizioni},Crefname={Definizione}{Definizioni},list
- inside=def,number within=chapter]{Def}{Definizione}{defstyle}{def}
- \let\marginnote\someundefinedcommand
- \usepackage{marginnote}
- \renewcommand*{\marginfont}{\footnotesize}
- \usepackage{caption}
- \usepackage{float}
- %%\theoremstyle{break}
- %%\theoremprework{%
- %% \def\FrameCommand{
- %% {\color{BrickRed}{\hspace{-8pt}\vrule width 2pt\hspace{0.5cm}}}
- %% }
- %% \medbreak%
- %%}
- %\theorempostwork{\medbreak}
- %\theorembodyfont{\slshape}
- %%\theoremheaderfont{\kern-5mm\normalfont\bfseries}
- %\theoremseparator{:}
- %\theoremsymbol{\ensuremath{\diamondsuit}}
- %\newtheorem{Thm}{Teorema}
- %\tcolorboxenvironment{Thm}{enhanced jigsaw,colframe=BrickRed,colback=BrickRed!7,breakable,
- %before skip=10pt,after skip=10pt }
- %
- %%\theoremstyle{break}
- %%\theoremprework{%
- %% \def\FrameCommand{
- %% {\color{OliveGreen}{\hspace{-8pt}\vrule width 2pt\hspace{0.5cm}}}
- %% }
- %% \medbreak%
- %%}
- %%\theorempostwork{\medbreak}
- %%\theorembodyfont{\rmfamily}
- %%\theoremheaderfont{\kern-5mm\normalfont\bfseries}
- %%\theoremseparator{.}
- %%\theoremsymbol{\ensuremath{\clubsuit}}
- %%\newframedtheorem{Def}{Definizione}
- %
- %\theoremstyle{plain}
- %\theoremsymbol{\ensuremath{\clubsuit}}
- %\theorembodyfont{\upshape}
- %\theoremprework{\bigskip\noindent\makebox[\linewidth]{\color{OliveGreen}
- %\rule{\textwidth}{1pt}}}
- %\theorempostwork{\noindent\makebox[\linewidth]{\color{OliveGreen}
- %\rule{\textwidth}{1pt}}\bigskip}
- %\newtheorem{Def}{Definizione}
- %
- %\theoremstyle{change}
- %\theorembodyfont{\upshape}
- %\theoremsymbol{\ensuremath{\ast}}
- %\theoremseparator{}
- %\newtheorem{Ex}{Esempio}
- %
- %\theoremheaderfont{\sc}
- %\theorembodyfont{\upshape}
- %\theoremstyle{nonumberplain}
- %\theoremseparator{}
- %\theoremsymbol{\rule{1ex}{1ex}}
- %\newtheorem{Proof}{Dimostrazione}
- \newcommand{\monthyear}{%
- \ifcase\month\or Gennaio\or Febbraio\or Marzo\or Aprile\or Maggio\or Giugno\or
- Luglio\or Agosto\or Settembre\or Ottobre\or Novembre\or
- Dicembre\fi\space\number\year
- }
- % Reset counter for footnotes
- \let\oldchapter\chapter
- \def\chapter{%
- \setcounter{footnote}{0}%
- \oldchapter
- }
- % Matrix with column separators
- \makeatletter
- \renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
- \hskip -\arraycolsep
- \let\@ifnextchar\new@ifnextchar
- \array{#1}}
- \makeatother
- % Reset counter for equations
- \numberwithin{equation}{section}
- % For an older but clearer root. Still \oldsqrt is valid %%
- \usepackage{letltxmacro}
- \makeatletter
- \let\oldr@@t\r@@t
- \def\r@@t#1#2{%
- \setbox0=\hbox{$\oldr@@t#1{#2\,}$}\dimen0=\ht0
- \advance\dimen0-0.2\ht0
- \setbox2=\hbox{\vrule height\ht0 depth -\dimen0}%
- {\box0\lower0.4pt\box2}}
- \LetLtxMacro{\oldsqrt}{\sqrt}
- \renewcommand*{\sqrt}[2][\ ]{\oldsqrt[#1]{#2} }
- \makeatother
- % To import figures generated by Inkscape
- \usepackage{import}
- \usepackage{xifthen}
- \usepackage{pdfpages}
- \usepackage{transparent}
- % Note that you can use \incfig[width]{name} to specify a width for the image.
- % Defaults at \marginparwidth
- \makeatletter
- \def\incfig{\@ifnextchar[{\@with}{\@without}}
- \def\@with[#1]#2{%
- \def\svgwidth{#1}
- \import{./figures/}{#2.pdf_tex}
- }
- \def\@without#1{%
- \def\svgwidth{\marginparwidth}
- \import{./figures/}{#1.pdf_tex}
- }
- \makeatother
- \setcounter{tocdepth}{1}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement