-
Notifications
You must be signed in to change notification settings - Fork 85
/
prelude.tex
139 lines (118 loc) · 3.67 KB
/
prelude.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
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage[charter]{mathdesign}
\usepackage{geometry}
\geometry{
a4paper,
total={170mm,257mm},
left=.9in,
top=1.0in,
bottom=1.5in,
right=.9in,
}
\setlength{\columnsep}{.5in}
\usepackage{fancyhdr}
\usepackage{xcolor}
\usepackage{mdframed}
\usepackage{setspace}
\usepackage{mfirstuc}
\usepackage{graphicx,changepage}
\usepackage{pgffor}
% For development
\usepackage{comment}
% Make hyperrefs work
\usepackage{hyperref}
% Set up bibliography
\usepackage[semicolon,square,sort&compress,sectionbib,numbers]{natbib}
% Chapter by chapter bib
\usepackage{chapterbib}
% Set up source code highlighting
\usepackage{listings}
\lstset{
basicstyle=\ttfamily,
columns=flexible,
breaklines=true
}
\usepackage[usenames,dvipsnames]{color}
\definecolor{greencomments}{rgb}{0,0.5,0}
\definecolor{redstrings}{rgb}{0.9,0,0}
\definecolor{mygreen}{rgb}{0,0.6,0}
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
\definecolor{mymauve}{rgb}{0.58,0,0.82}
\definecolor{foreground}{HTML}{4D4D4C}
\definecolor{background}{HTML}{FFFFFF}
\definecolor{selection}{HTML}{D6D6D6}
\definecolor{line}{HTML}{EFEFEF}
\definecolor{comment}{HTML}{8E908C}
\definecolor{red}{HTML}{C82829}
\definecolor{orange}{HTML}{F5871F}
\definecolor{yellow}{HTML}{EAB700}
\definecolor{green}{HTML}{718C00}
\definecolor{aqua}{HTML}{3E999F}
\definecolor{blue}{HTML}{4271AE}
\definecolor{purple}{HTML}{8959A8}
\definecolor{window}{HTML}{EFEFEF}
% Has to be name shadecolor
\definecolor{shadecolor}{HTML}{EEEEEE}
\usepackage{framed}
\newcommand{\CodeSymbol}[1]{\textcolor{red}{#1}\bfseries}
\lstset{aboveskip=20pt,
belowskip=20pt,
xleftmargin=1.5cm,
xrightmargin=1.5cm,
xtopmargin=1cm,
xbottommargin=1cm,
framexrightmargin=.5em,
framexleftmargin=.5em,
frame=bt,
framextopmargin=5pt,
framexbottommargin=5pt,
backgroundcolor=\color{shadecolor},
rulecolor=\color{shadecolor},}
% Define syntax highlighting style
\usepackage{listings}
% set up quotes
\usepackage{epigraph}
\renewcommand{\epigraphrule}{0pt}
\setlength{\epigraphwidth}{.6\textwidth}
\renewcommand{\textflush}{flushepinormal}
\makeatletter
% Taken and updated from http://mirrors.ctan.org/macros/latex/contrib/epigraph/epigraph.dtx
\renewcommand{\@epitext}[1]{%
\begin{minipage}{\epigraphwidth}\begin{\textflush} \hspace*{30pt}#1\\
\ifdim\epigraphrule>\z@ \@epirule \else \vspace*{-.5\baselineskip} \fi
\end{\textflush}\end{minipage}}
\makeatother
% Define titles and chapter
\usepackage[Bjornstrup]{fncychap}
\singlespacing
\title{\vspace{-15mm}\fontsize{24pt}{10pt}\selectfont\textbf{CS341 System Programming Coursebook}}
\date{}
% define custom environments, so we can change global style at will
\newcommand{\keyword}[1]{\underline{\smash{\textbf{\texttt{#1}}}}}
\newcommand{\todo}[1]{}
\renewcommand{\todo}[1]{{\color{red} TODO: {#1}}}
\lstnewenvironment{lstlisting}[1][]%
{\noindent\minipage{\linewidth}\medskip
\lstset{basicstyle=\ttfamily\footnotesize,frame=single,#1}}
{\endminipage}
% For pictures
\newenvironment{proof}{\begin{shaded*}\paragraph{Proof:}}{\hfill$\square$\end{shaded*}}
\newenvironment{tableau}{\begin{shaded*}\begin{longtable}}{\end{longtable}\end{shaded*}}
\usepackage{wrapfig}
% 100/90/10/77
\definecolor{titlepagecolor}{cmyk}{1,.9,.1,.77}
\definecolor{linecolor}{cmyk}{.01,.83,.84,0}
\definecolor{namecolor}{cmyk}{1,.50,0,.10}
%-----------------------------------------------------------------
\usepackage{csquotes}
% this is a terrible hack, but pandoc sucks
% we have to call any
\lstnewenvironment{minted}{m}
{\noindent\minipage{\linewidth}\medskip
\lstset{basicstyle=\ttfamily\footnotesize,frame=single,language=#1}}
{\endminipage}
\usepackage{float}
% title spacing
\usepackage[compact]{titlesec}
\renewcommand{\baselinestretch}{1.15}