-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreamble.tex
124 lines (112 loc) · 3.81 KB
/
preamble.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
\documentclass[12pt, letterpaper]{report}
\usepackage[a4paper,
bindingoffset=0.2in,
left=1in,
right=1in,
top=1in,
bottom=1in,
footskip=.25in]{geometry}
\usepackage{graphicx} % Required for inserting images
\usepackage{listings}
\usepackage{xcolor}
\usepackage{color}
\usepackage[T1]{fontenc}
\usepackage{inconsolata}
\usepackage{fancyhdr}
\usepackage{extramarks}
\usepackage{titlesec}
\usepackage{hyperref}
\usepackage[macchiato]{catppuccin}
% Header and footer syles
\newcommand{\sectionTop}[1]{
\heading{#1}
\sectionContinue{#1}
\renewcommand{\sectionContinue}[1]{
\afterpage{
\heading{#1 Continued}
\sectionContinue{#1}
}
}
}
\fancypagestyle{plain}{%
\fancyhf{}%
\renewcommand{\headrulewidth}{0.4pt}%
\renewcommand{\footrulewidth}{0.4pt}%
\fancyhead[R]{\itshape\nouppercase{\rightmark}}%
\fancyfoot[C]{\thepage}
}
\fancypagestyle{general}{%
\fancyhf{}%
\renewcommand{\headrulewidth}{0.4pt}%
\renewcommand{\footrulewidth}{0.4pt}%
\fancyhead[R]{\itshape\nouppercase{\rightmark}}%
\fancyfoot[C]{\thepage}
}
\pagestyle{general}
% Remove space above title
\usepackage{titling}
% Style section headers
\usepackage{sectsty}
\sectionfont{\color{ctpBlue}}
\subsectionfont{\color{ctpSky}}
% Decrease space above chapters and color
\titleformat{\chapter}[block]
{\normalfont\huge\bfseries\color{ctpMaroon}}{\chaptertitlename\ \thechapter{: }}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{-40pt}{40pt}
% Set default paragraph indent to 0
\setlength{\parindent}{0pt}
% Code styling
\lstdefinestyle{python}{
language={Python},
breaklines=true,
showstringspaces=false,
breakatwhitespace=true,
stringstyle = {\color{ctpGreen}},
commentstyle={\color{ctpOverlay2}},
basicstyle = {\small\color{ctpText}\ttfamily},
keywordstyle = {\color{ctpMauve}},
keywordstyle = [2]{\color{ctpBlue}},
keywordstyle = [3]{\color{ctpYellow}},
keywordstyle = [4]{\color{ctpOverlay1}},
keywordstyle = [5]{\color{ctpPeach}},
keywordstyle = [6]{\color{ctpTeal}},
keywordstyle = [7]{\color{ctpRed}},
otherkeywords = {<, >, ||, =, ?, \{, \}, 0,1,2,3,4,5,6,7,8,9, (, ), [, ], len, list, items, target, one, two, two_sum, nums, k },
morekeywords = [2]{binary_search, maximum_subarray, two_sum},
morekeywords = [3]{ \{, \}, dict, list},
morekeywords = [4]{(, ), [, ]},
morekeywords = [5]{0, 1,2,3,4,5,6,7,8,9, defaultdict, list, len},
morekeywords = [6]{<, >, ||, =, ?},
morekeywords = [7]{items, target, one, two, nums, k},
}
\lstdefinestyle{c}{
language={C},
breaklines=true,
showstringspaces=false,
breakatwhitespace=true,
stringstyle = {\color{ctpGreen}},
commentstyle={\color{ctpOverlay1}},
basicstyle = {\small\color{ctpText}\ttfamily},
keywordstyle = {\color{ctpYellow}},
keywordstyle = [2]{\color{ctpBlue}},
keywordstyle = [3]{\color{ctpYellow}},
keywordstyle = [4]{\color{ctpGreen}},
keywordstyle = [5]{\color{ctpPeach}},
keywordstyle = [6]{\color{ctpTeal}},
keywordstyle = [7]{\color{ctpOverlay2}},
keywordstyle = [8]{\color{ctpRed}},
emph={sizeof, for, \#, include, using},
emphstyle={\color{ctpMauve}},
otherkeywords = {namespace, (, ), \{, \}, stdio.h, sizeof, for, <, >, ||, include, \#, =, -, +, ?, *, 0, 1,2,3,4,5,6,7,8,9},
morekeywords = [2]{maximumSubarray, max, main, printf, twoSum, maximumSubarray, binary_search, string},
morekeywords = [3]{PageController, ApplicationController, Page},
morekeywords = [4]{stdio.h, map, vector, pair},
morekeywords = [5]{0, 1,2,3,4,5,6,7,8,9},
morekeywords = [6]{<, >, ||, =, ?, *, -, +},
morekeywords = [7]{(, ), \{, \}},
morekeywords = [8]{nums, numsSize, target, k},
}
% Also code styling, but highlights digits
\usepackage{etoolbox}
\newtoggle{InString}{}% Keep track of if we are within a string
\togglefalse{InString}% Assume not initally in string