Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \usepackage[sfdefault]{roboto}
- \usepackage[capitalize,noabbrev,nameinlink,italian]{cleveref}
- %%%% 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
- % 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=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=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=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}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement