-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodeenv.sty
More file actions
44 lines (38 loc) · 1.02 KB
/
codeenv.sty
File metadata and controls
44 lines (38 loc) · 1.02 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
\ProvidesPackage{codeenv}
\usepackage{xcolor}
\usepackage{listings}
\usepackage{lstautogobble}
\usepackage{courier}
% Use a monospaced font (courier), for source code listings (because quite frankly you'd be an idiot not to)
\lstset{
basicstyle=\footnotesize\ttfamily,
breaklines=true
}
\definecolor{comment}{HTML}{999988}
\definecolor{keyword}{HTML}{222222}
\definecolor{function}{HTML}{445588}
\definecolor{type}{HTML}{555555}
\lstdefinestyle{default}{%
basicstyle=\scriptsize\ttfamily,
keywordstyle=\bf\color{function}\ttfamily,
stringstyle=\color{red}\ttfamily,
commentstyle=\it\color{comment}\ttfamily,
morecomment=[l][\color{magenta}]{\#},
showstringspaces=false,
numberstyle=\tiny\color{red},
tabsize=4,
breaklines,
numbers=left,
numberstyle=\tiny\color{type}
}
\lstnewenvironment{code}[2][] {
\lstset{language=#2,
style=default,
autogobble,
escapechar=§,
#1
}
}{}
\newcommand{\codefile}[2][]{
\lstinputlisting[style=default, #1]{#2}
}