-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathteamnote.sty
86 lines (62 loc) · 2.5 KB
/
teamnote.sty
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
\ProvidesPackage{teamnote}
% \usepackage[left=0.3cm,right=0.3cm,top=0.6cm,bottom=0.3cm,headsep=0.1cm,a4paper]{geometry}
\usepackage[left=0.1cm,right=0.1cm,top=0.3cm,bottom=0.1cm,headsep=0cm,a4paper]{geometry}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{minted}
\usepackage{color}
\usepackage{indentfirst}
\setlength{\columnseprule}{0.1pt}
\pagenumbering{arabic}
\setminted{breaklines=true, tabsize = 2, breaksymbolleft=}
\usemintedstyle{perldoc}
\newcommand{\revised}{Should be \textcolor{red}{\textbf{revised}}.}
\newcommand{\tested}{Should be \textcolor{red}{\textbf{tested}}.}
\newcommand{\added}{Should be \textcolor{red}{\textbf{added}}.}
\newcommand{\WIP}{\textcolor{red}{\textbf{WIP}}}
\newcommand{\schoolname}{}
\newcommand{\teamname}{}
\newcommand{\authorname}{}
\newcommand{\contestname}{}
\newcommand{\maketitlepage}{\maketitle
\tableofcontents
\thispagestyle{fancy}
}
\DeclareRobustCommand{\teamnote}[4]{
\renewcommand{\schoolname}{#1}
\renewcommand{\teamname}{#2}
\renewcommand{\authorname}{#3}
\renewcommand{\contestname}{#4}
}
\pagestyle{fancy}
\lhead{\schoolname{} -- \teamname}
\rhead{Page \thepage{} of
\ifthenelse{\pageref{LastPage} < 26}{\pageref{LastPage}}{\textcolor{red}{\textbf{\pageref{LastPage}}}}}
\fancyfoot{}
\title{Team Note of \teamname}
\author{\authorname\\\\\contestname}
\date{}
% \date{Compiled on \today}
\newboolean{BangShowUsage}
\setboolean{BangShowUsage}{false}
\newcommand{\ShowUsage}{\setboolean{BangShowUsage}{false}}
\newcommand{\HideUsage}{\setboolean{BangShowUsage}{true}}
\newboolean{BangShowComplexity}
\setboolean{BangShowComplexity}{false}
\newcommand{\ShowComplexity}{\setboolean{BangShowComplexity}{false}}
\newcommand{\HideComplexity}{\setboolean{BangShowComplexity}{true}}
\newboolean{BangShowAuthor}
\setboolean{BangShowAuthor}{false}
\newcommand{\ShowAuthor}{\setboolean{BangShowAuthor}{false}}
\newcommand{\HideAuthor}{\setboolean{BangShowAuthor}{true}}
\newcommand{\Algorithm}[6]{
\subsection{#1}
\ifthenelse{\equal{#2}{} \OR \boolean{BangShowUsage}}{}{\textbf{Usage:} #2}
\ifthenelse{\equal{#3}{} \OR \boolean{BangShowComplexity}}{}{\textbf{Time Complexity:} #3}
\ifthenelse{\equal{#6}{} \OR \boolean{BangShowAuthor}}{}{\textbf{Author:} #6}
\ifthenelse{\equal{#5}{}}{}{\ifthenelse{\equal{#4}{}}{\inputminted[]{cpp}{#5}}{\inputminted[]{#4}{#5}}}
}
\newcommand{\TeamnoteImport}[2]{ % title, code dir
\immediate\write18{python3 preprocessor.py #2 build/tempfile.tmp}
\immediate\Algorithm{#1}{}{}{cpp}{build/tempfile.tmp}{}
}