-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode-handout.sty
More file actions
82 lines (64 loc) · 1.97 KB
/
code-handout.sty
File metadata and controls
82 lines (64 loc) · 1.97 KB
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
\ProvidesPackage{code-handout}
\usepackage[left=24mm, right=25mm, top=25mm, bottom=25mm]{geometry}
\usepackage{helvet}
\usepackage[svgnames]{xcolor}
\usepackage{minted}
\usepackage{caption}
\usepackage{fancyhdr}
\usepackage{enumitem}
\usepackage{sectsty}
\usepackage{titlesec}
\usepackage{ifthen}
\AtBeginDocument {
% add a section with title if title is specified
\ifthenelse{\not\equal{\@title}{}}{\section*{\@title}}{}
}
\renewcommand{\familydefault}{\sfdefault}
\renewcommand{\baselinestretch}{1.15}
% remove first line paragraph indent
\setlength{\parindent}{0mm}
% remove left indent inside lists using enumerate or itemize
\setlist[enumerate,1]{left=0mm}
\setlist[itemize,1]{left=0mm}
\BeforeBeginEnvironment{listing}{\addvspace{-1mm}}
\AfterEndEnvironment{listing}{\addvspace{-1mm}}
\titlespacing*{\section}{0pt}{0pt}{1.5mm}
\titlespacing*{\subsection}{0pt}{0pt}{8mm}
\definecolor{sectioncolor}{HTML}{8d6bea}
\definecolor{subsectioncolor}{HTML}{77c0cf}
\sectionfont{\color{sectioncolor}\fontsize{22}{20}\selectfont}
\subsectionfont{\color{subsectioncolor}\fontsize{14}{10}\selectfont}
\fancyfootoffset[lhr]{8mm}
\newcommand{\footerfont}{\fontsize{8}{10}\selectfont\textcolor{gray}}
\newcommand{\customfooter}{
\fancyhf{} % clear all header and footer fields
\fancyfoot[R]{\footerfont{\thepage}}
\fancyfoot[L]{\footerfont{\@author}}
}
\fancypagestyle{first}{\customfooter}
\fancypagestyle{rest}{
\customfooter
\fancyhead[L]{\footerfont{\@title}}
\fancyfoot[L]{}
}
\thispagestyle{first}
\pagestyle{rest}
\renewcommand{\listingscaption}{}
\renewcommand{\headrulewidth}{0mm}
\definecolor{background}{HTML}{fafbfc}
\setminted{
style=handout,
bgcolor=background,
bgcolorpadding=4.5mm,
tabsize=3,
samepage=true}
% reduce space above captions
\setlength{\abovecaptionskip}{-2mm}
% remove numbering from minted captions
\DeclareCaptionLabelFormat{nolabel}{}
\captionsetup[listing]{
labelformat=nolabel,
justification=raggedright,
singlelinecheck=false,
size=small,
font={color=gray}}