Skip to content

Commit dcd3d95

Browse files
Chilleesimonlindholm
authored andcommitted
Added coloring to code snippets (off by default) (kth-competitive-programming#65)
1 parent fff09dd commit dcd3d95

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ To build KACTL, type `make kactl` (or `make fast`) on a \*NIX machine -- this wi
3737
kactl.pdf is to be kept to 25 pages + cover page.
3838
Occasionally the generated kactl.pdf is committed to the repo for convenience, but not too often because it makes git operations slower.
3939

40-
Before printing KACTL for an official contest, you may want to locally change the arguments to `\team`, `\contest`, etc. in build/kactl.tex to something more fitting.
40+
Before printing KACTL for an official contest, you may want to locally change the arguments to `\team`, `\contest`, etc. in build/kactl.tex to something more fitting,
41+
You may also enable colored syntax highlighting in the same file.
4142

4243
To upstream your changes, [send a pull request](https://help.github.com/articles/fork-a-repo/).
4344

build/kactl.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
\team{Omogen Heap}{Simon Lindholm, Johan Sannemo, Mårten Wiman}
77
% \contest{ACM-ICPC World Finals 2017}{May 24, 2017}
88
\contest{\ }{\today}
9+
% \enablecolors
910

1011
\begin{document}
1112
\maketeampage

build/kactlpkg.sty

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,16 @@
3939
\def\@unilogo{#3}
4040
}
4141

42+
\newcommand{\enablecolors}{
43+
\lstset{commentstyle=\color{darkgray}\normalfont\itshape}
44+
\lstset{keywordstyle=\color{myblue}}
45+
\lstset{identifierstyle=\color{black}}
46+
}
47+
4248
% Some default config
4349
\subtitle{{\tiny new}KACTL}
4450
\title{KTH ACM Contest Template Library}
51+
\newcommand{\PDFColor}{0}
4552

4653
\def\today{\number\year-\ifthenelse{\number\month<10}{0}{}\number\month-\ifthenelse{\number\day<10}{0}{}\number\day} % Defines \today as YYYY-MM-DD
4754

@@ -158,6 +165,9 @@
158165
}
159166
\renewcommand*{\tilde}{\raise.17ex\hbox{$\scriptstyle\mathtt{\sim}$}}
160167

168+
\definecolor{mygreen}{HTML}{007000}
169+
\definecolor{myblue}{HTML}{0000dd}
170+
161171
% Configure source code listings
162172
\lstset{language=C++}
163173
\lstset{morekeywords={alignas,alignof}}

0 commit comments

Comments
 (0)