-
Notifications
You must be signed in to change notification settings - Fork 0
/
h_misc.tex
141 lines (128 loc) · 4.84 KB
/
h_misc.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
% ------------------------------------------------------------------------------
% --------------------------------- LICENSE ----------------------------------
% ------------------------------------------------------------------------------
% Except where otherwise noted, this work by Noita Enola is licensed under CC BY-SA 4.0. You can check a copy of the license by looking at the LICENSE.md file, or at <https://creativecommons.org/licenses/by-sa/4.0>.
% ------------------------------------------------------------------------------
% These two speed up compilation time but produce a larger PDF. Should be commented before doing the final build: https://tex.stackexchange.com/a/454235
\pdfcompresslevel=0
\pdfobjcompresslevel=0
% ------------------------------------------------------------------------------
% ToDo notes in the margins
%\usepackage[textsize=scriptsize]{todonotes}
% \setlength{\marginparwidth}{2cm}
% ------------------------------------------------------------------------------
% Sections of text in multiple columns
\usepackage{multicol}
% ------------------------------------------------------------------------------
% To ease customizing of list environments
\usepackage{enumitem}
% ------------------------------------------------------------------------------
% Nice code snippets typestting
\usepackage[skins, breakable, minted]{tcolorbox}
\colorlet{bg}{black!5!white} % background color for snippets
% \definecolor{bg}{rgb}{0.95,0.95,0.95}
\newcommand{\pythonScript}[3]{% Shortcut for inputting python scripts
\begin{tcolorbox}[%
arc = 0mm,
colback = bg,
coltitle = black,
colframe = bg,
titlerule = 1pt,
titlerule style = black,
bottomrule = 1pt,
title = #1,
fonttitle =\sffamily\bfseries,
breakable = true,
title after break = #1 (cont.),
toprule at break = 0pt,
bottomrule at break = 0pt,
% code = {},
]%
\captionsetup{type=script}% Putting \captionsetup outside the tcolorbox (or using code = {...}) misplaces some anchors in the previous pages when the snippet is the first thing of the page. Putting it here makes the links point just below the script title. I think it's the best compromise.
\inputminted[
breaklines,
breakafter = /,
fontfamily = tt,
tabsize = 4,
fontsize = \small,
]{python}{./scripts/#1}%
\vspace{-0.5\baselineskip}
\caption{#2}
\end{tcolorbox}%
}
% ------------------------------------------------------------------------------
% Advanced bibliographic facilities
\usepackage[style=numeric,sorting=none,sortcites]{biblatex}
\addbibresource{bibliography.bib}
%\renewcommand{\cite}[1]{\textbf{[#1]}}
% Package csquotes is recommended by the biblatex docs
\usepackage{csquotes}
% ------------------------------------------------------------------------------
% Support for putting documents under a license
\usepackage[
type = {CC},
modifier = {by-sa},
version = {4.0},
]{doclicense}
% ------------------------------------------------------------------------------
% Nice, simple directory trees. By Guilherme Zanotelli: https://tex.stackexchange.com/questions/5073/making-a-simple-directory-tree
\usepackage[edges]{forest}
\definecolor{foldercolor}{RGB}{124,166,198}
\tikzset{%
pics/folder/.style = {%
code = {%
\node[inner sep=0pt, minimum size=#1](-foldericon){};
\node[folder style, inner sep=0pt, minimum width=0.3*#1, minimum height=0.6*#1, above right, xshift=0.05*#1] at (-foldericon.west){};
\node[folder style, inner sep=0pt, minimum size=#1] at (-foldericon.center){};
}
},
pics/folder/.default = {20pt},
folder style/.style = {%
draw = foldercolor!80!black,
top color = foldercolor!40,
bottom color = foldercolor
}
}
\forestset{%
is file/.style = {%
edge path'/.expanded = {%
([xshift = \forestregister{folder indent}]!u.parent anchor) |- (.child anchor)
},
inner sep = 1pt
},
this folder size/.style = {%
edge path'/.expanded = {%
([xshift=\forestregister{folder indent}]!u.parent anchor) |- (.child anchor) pic[solid]{folder=#1}
},
inner xsep = 0.6*#1
},
folder tree indent/.style = {%
before computing xy = {l=#1}
},
folder icons/.style = {%
folder,
this folder size = #1,
folder tree indent = 3*#1
},
folder icons/.default = {12pt},
}
% ------------------------------------------------------------------------------
% Menu sequences, paths and keystrokes formatting
\usepackage[os=win]{menukeys}
\renewmenumacro{\directory}[/]{paths}
\renewmenumacro{\keys}[+]{shadowedroundedkeys}
% ------------------------------------------------------------------------------
% Hypertext support for LaTeX
\usepackage[
bookmarks = true,
bookmarksopen = true,
bookmarksdepth = 3,
bookmarksopenlevel = 0,
bookmarksnumbered = true,
% hidelinks = true,
colorlinks = true,
allcolors = blue!30!black,
pdfusetitle = true,
pdfstartview = Fit,
pdfpagelayout = TwoPageRight,
]{hyperref}