Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
761
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.47 KB | None | 0 0
  1. \usepackage[sfdefault]{roboto}
  2.  
  3. \usepackage[capitalize,noabbrev,nameinlink,italian]{cleveref}
  4.  
  5. %%%% Sections styles %%%%%
  6. \usepackage{titlesec,titletoc}
  7.  
  8. \setcounter{secnumdepth}{2}
  9.  
  10. % chapter format
  11. \titleformat{\chapter}%
  12. {\huge\rmfamily\itshape\color{def1}}% format applied to label+text
  13. {\llap{\colorbox{def1}{\parbox{1.5cm}{\hfill\itshape\huge\color{white}\thechapter}}}}% label
  14. {2pt}% horizontal separation between label and title body
  15. {}% before the title body
  16. %{\titlerule*[0.7em]{.}\rmfamily\upshape\thechapter} % filler + page (leaders and page num)
  17. []% after the title body
  18.  
  19. % section format
  20. \titleformat{\section}%
  21. {\normalfont\Large\itshape\color{theorem1}}% format applied to label+text
  22. {\llap{\colorbox{theorem1}{\parbox{1.5cm}{\hfill\color{white}\thesection}}}}% label
  23. {1em}% horizontal separation between label and title body
  24. {}% beforethe title body
  25. []% after the title body
  26.  
  27. % subsectionformat
  28. \titleformat{\subsection}%
  29. {\normalfont\large\itshape\color{ex1}}% format applied to label+text
  30. {\llap{\colorbox{ex1}{\parbox{1.5cm}{\hfill\color{white}\thesubsection}}}}% label
  31. {1em}% horizontal separation between label and title body
  32. {}% beforethe title body
  33. []% after the title body
  34.  
  35. %%%% TOC CHANGES %%%%
  36. \titlecontents{chapter}%
  37. [-4em] % distance from left margin
  38. {\fontsize{15}{25}\itshape\bfseries} % above (global formatting of entry)
  39. {\hspace*{2em}\textcolor{def1}{\contentslabel{2em}}} % before w/label (label = ``2.6'')
  40. {\hspace*{2em}} % before w/o label
  41. {\titlerule*[0.7em]{.}\rmfamily\upshape\contentspage} % filler + page (leaders and page num)
  42. [] % after
  43.  
  44. \titlecontents{section}%
  45. [0em] % distance from left margin
  46. {\fontsize{11}{15}\itshape} % above (global formatting of entry)
  47. {\hspace*{2em}\textcolor{theorem1}{\contentslabel{2em}}} % before w/label (label = ``2.6'')
  48. {\hspace*{2em}} % before w/o label
  49. {\titlerule*[0.7em]{.}\rmfamily\upshape\contentspage} % filler + page (leaders and page num)
  50. [] % after
  51.  
  52.  
  53. % Theorems, Definitions and Examples
  54.  
  55. \usepackage[theorems,skins,breakable,listings]{tcolorbox}
  56.  
  57. \definecolor{theorem1}{HTML}{ff8f00}
  58. \definecolor{theorem2}{HTML}{ffca28}
  59.  
  60. \definecolor{def1}{HTML}{2e7d32}
  61. \definecolor{def2}{HTML}{66bb6a}
  62.  
  63. \definecolor{ex1}{HTML}{1565c0}
  64. \definecolor{ex2}{HTML}{42a5f5}
  65.  
  66. \tcbset{
  67. defstyle/.style={
  68. breakable,
  69. theorem style=plain apart,
  70. enhanced,
  71. sharp corners,
  72. frame hidden,
  73. colbacktitle=def1,
  74. colback=def2!50!white,
  75. coltitle=white,
  76. boxrule=0pt,
  77. titlerule=1mm,
  78. titlerule style=def1!50!black,
  79. fonttitle=\upshape\bfseries,
  80. fontupper=\upshape,
  81. boxrule=0.4pt,
  82. halign=left
  83. },
  84. exstyle/.style={
  85. breakable,
  86. theorem style=plain apart,
  87. enhanced,
  88. sharp corners,
  89. frame hidden,
  90. colbacktitle=ex1,
  91. colback=ex2!50!white,
  92. coltitle=white,
  93. boxrule=0pt,
  94. titlerule=1mm,
  95. titlerule style=ex1!50!black,
  96. fonttitle=\upshape\bfseries,
  97. fontupper=\upshape,
  98. boxrule=0.4pt,
  99. halign=left
  100. },
  101. thmstyle/.style={
  102. breakable,
  103. theorem style=plain apart,
  104. enhanced,
  105. sharp corners,
  106. frame hidden,
  107. colbacktitle=theorem1,
  108. colback=theorem2!50!white,
  109. coltitle=white,
  110. boxrule=0pt,
  111. titlerule=1mm,
  112. titlerule style=theorem1!50!black,
  113. fonttitle=\upshape\bfseries,
  114. fontupper=\itshape,
  115. boxrule=0.4pt,
  116. halign=left
  117. },
  118. proofstyle/.style={
  119. breakable,
  120. enhanced,
  121. theorem style=plain,
  122. frame hidden,
  123. sharp corners,
  124. colback=gray!15!white,
  125. boxrule=0pt,
  126. before skip=10pt,
  127. after skip=10pt,
  128. borderline west={1mm}{0pt}{darkgray},
  129. fonttitle=\bfseries,
  130. coltitle=black,
  131. title=Dimostrazione,
  132. halign=left
  133. }
  134. }
  135.  
  136. % This allows for the skins library to not be externalized by Tikz, removing problems
  137. \tcbset{shield externalize}
  138. \makeatletter
  139. % add tcblistings to \jobname.lol (list of listings)
  140. \tcbset{
  141. addtolol/.style={list entry={\kvtcb@title},add to list={lol}{subsection}},
  142. }
  143. \makeatother
  144.  
  145. \newtcbtheorem[crefname={teorema}{teoremi},Crefname={Teorema}{Teoremi},list
  146. inside=thm,number within=chapter]{Thm}{Teorema}{thmstyle}{thm}
  147. \newtcbtheorem{Proof}{Dimostrazione}{proofstyle}{}
  148. \newtcbtheorem[crefname={esempio}{esempi},Crefname={Esempio}{Esempi},list
  149. inside=ex,number within=chapter]{Ex}{Esempio}{exstyle}{ex}
  150. \newtcbtheorem[crefname={definizione}{definizioni},Crefname={Definizione}{Definizioni},list
  151. inside=def,number within=chapter]{Def}{Definizione}{defstyle}{def}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement