-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodeproblem.cls
More file actions
85 lines (76 loc) · 2.45 KB
/
codeproblem.cls
File metadata and controls
85 lines (76 loc) · 2.45 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
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{codeproblem}[2014/02/14 v1.0 Template for Code Competitions]
\LoadClass{article}
%Imports
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsmath, amsthm, amssymb} %Used in homework
\usepackage{units} %Used in homework
\usepackage{changepage, multicol} %Used for answer boxes
\usepackage{adjustbox, xcolor} %Used for question boxes
\usepackage{marvosym} %Used in proof section
\usepackage{fouriernc} %Changes font
\usepackage[T1]{fontenc} %Changes font
\usepackage{fancyhdr, lscape, lastpage}%Used for header
\usepackage{listings} %Used for example
\usepackage{bera} %Used for monospace bold.
%Setmargins
\usepackage[includeheadfoot,margin=0.75in]{geometry}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Setup listing
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\lstset{basicstyle=\ttfamily,
escapeinside={||},
mathescape=true}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Init header
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagestyle{fancy}
\lhead{\today}
\chead{ACM Programming Competition}
\rhead{ENMU vs NMT}
\cfoot{}
\rfoot{\thepage\ of \pageref{LastPage}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Title
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\title}[1]{\vspace*{1em}\centerline{\textbf{\Huge #1}}\vspace{3em}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Example
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newenvironment{example}
{
\vspace{1em}
\begin{center}
\begin{minipage}{\linewidth}
\begin{center}
\begin{adjustbox}{minipage=.5\linewidth,
margin=1ex,
bgcolor={HTML}{D9ECFF}
}
\begin{lstlisting}
}
{
\end{lstlisting}
\end{adjustbox}
\end{center}
\end{minipage}
\end{center}
\vspace{1em}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Flavor environments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%TODO:
%Unify answer and answer* with a key value argument with the default
%value of 1.
\newenvironment{flavor}{
\vspace{1ex}
\begin{center}
\begin{adjustwidth}{.2\linewidth}{.2\linewidth}
\begin{itshape}
}
{
\end{itshape}
\end{adjustwidth}
\end{center}
}