-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmain.sty
More file actions
189 lines (155 loc) · 4.37 KB
/
main.sty
File metadata and controls
189 lines (155 loc) · 4.37 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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
\usepackage{emptypage}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage{lmodern}
\usepackage{pdflscape}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{verbatim}
% \newcommand{\nothtml}{\comment}
\usepackage{listings}
\usepackage[hyperfootnotes=false]{hyperref}
\usepackage{exercise}
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage[noend]{algpseudocode}
\usepackage[toc,page]{appendix}
\usepackage{answers}
\usepackage[secthm,mdthm]{evan}
\lhead{Hsiang, Wei, Liu}
\usepackage{graphicx}
\usepackage{color}
\definecolor{myseagreen}{RGB}{88,197,191}
\definecolor{mysalmon}{RGB}{255,160,122}
\definecolor{myred}{RGB}{255,102,102}
\definecolor{mypurple}{RGB}{225,145,255}
\definecolor{myblack}{RGB}{0,0,0}
\definecolor{mywhite}{RGB}{255,255,255}
\usepackage{tikz}
\usetikzlibrary{calc,shapes.multipart,chains,arrows,positioning}
\tikzstyle{vertex}=[draw,fill=myseagreen,circle,minimum size=24pt,inner sep=0pt]
\tikzstyle{splitvertex}=[draw,fill=myseagreen,circle split,minimum size=24pt]
\usetikzlibrary{
shapes.multipart,
matrix,
positioning,
shapes.callouts,
shapes.arrows,
shapes.geometric,
decorations.shapes,
shapes,
fit,
arrows,
positioning,
trees,
mindmap,
calc}
\tikzset{
squarecross/.style={
draw, rectangle,minimum size=18pt, fill=myseagreen,
inner sep=0pt, text=black,
path picture = {
\draw[black]
(path picture bounding box.north west) --
(path picture bounding box.south east)
(path picture bounding box.south west) --
(path picture bounding box.north east);
}
}
}
\lstset{language=Java}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\makeatletter
\@ifpackageloaded{tex4ht}
{
\newcommand{\mylstlisting}{\verbatim}
}
{
\lstnewenvironment{mylstlisting}[1][]%
{\noindent\minipage{\linewidth}\medskip
\lstset{
backgroundcolor=\color{backcolour},
commentstyle=\color{codegreen},
keywordstyle=\color{magenta},
numberstyle=\tiny\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\footnotesize,
breakatwhitespace=false,
breaklines=true,
captionpos=t,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=4,
basicstyle=\ttfamily\footnotesize,
frame=single,#1}}
{\endminipage}
}
\makeatother
\raggedbottom
\usepackage{footnote}
\makesavenoteenv{tabular}
\makesavenoteenv{table}
\renewcommand{\arraystretch}{1.5}
% Alex's stuff.
% Make \emph bold.
\makeatletter
\DeclareRobustCommand{\em}{%
\@nomath\em \if b\expandafter\@car\f@series\@nil
\normalfont \else \bfseries \fi}
\makeatother
\usepackage{tabularx} % For more sophisticated tables.
\newenvironment{typewriter}{
\ttfamily
\fontdimen2\font=0.4em% interword space
\fontdimen3\font=0.2em% interword stretch
\fontdimen4\font=0.1em% interword shrink
\fontdimen7\font=0.1em% extra space
\hyphenchar\font=`\-% allowing hyphenation
}{\par}
% Commands for problem statements and sample cases.
% Command for generating problem statements. Optional argument is title. Others
% are problem statement, input specification, output specification, and source.
\newcommand{\statement}[7][]{
{\sffamily
\if\relax\detokenize{#1}\relax\else
\noindent{\large \textbf{#1}}
\fi
\hfill{\small\emph{Time limit: #2. Memory limit: #3.}}\par\nopagebreak
\noindent #4
\par\vspace{0.2em}
\if\relax\detokenize{#5}\relax\else
\noindent\textbf{Input}\par
\noindent #5
\fi
\par\vspace{0.2em}
\if\relax\detokenize{#6}\relax\else
\noindent\textbf{Output}\par
\noindent #6
\fi
\par\vspace{0.2em}
\if\relax\detokenize{#7}\relax\else
\noindent[Adapted from #7.]
\fi
\par\vspace{0.2em}
}
}
% Dummy command for \sample.
\newcommand{\sampel}[2]{
{\sffamily
\noindent\begin{tabularx}{\textwidth}{X|X}
\textbf{Sample Input} & \textbf{Sample Output} \\
{\ttfamily #1} & {\ttfamily #2}%
\end{tabularx}
\vspace{0.2em}
}\endgroup\par
}
% Make \sample respect newlines.
\newcommand{\sample}{
\begingroup\obeylines\sampel
}