langs.sty
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Wed, 27 Aug 2014 16:11:32 +0100
changeset 230 0fd668d7b619
parent 222 b712519b41d3
child 234 bf7eecc9cefe
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
218
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
\usepackage{listings}
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
\usepackage{xcolor}
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
\usepackage{fontspec}
230
0fd668d7b619 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 222
diff changeset
     4
\setmonofont[Scale=.88]{Consolas}
218
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
\newfontfamily{\consolas}{Consolas}
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
\definecolor{javared}{rgb}{0.6,0,0} % for strings
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
\definecolor{javagreen}{rgb}{0.25,0.5,0.35} % comments
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
\definecolor{javapurple}{rgb}{0.5,0,0.35} % keywords
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
\definecolor{javadocblue}{rgb}{0.25,0.35,0.75} % javadoc
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
\lstset{language=Java,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
	basicstyle=\ttfamily,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
	keywordstyle=\color{javapurple}\bfseries,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
	stringstyle=\color{javagreen},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
	commentstyle=\color{javagreen},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    17
	morecomment=[s][\color{javadocblue}]{/**}{*/},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    18
	numbers=left,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    19
	numberstyle=\tiny\color{black},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    20
	stepnumber=1,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    21
	numbersep=10pt,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    22
	tabsize=2,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    23
	showspaces=false,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    24
	showstringspaces=false}
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    25
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    26
\lstdefinelanguage{scala}{
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    27
  morekeywords={abstract,case,catch,class,def,%
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    28
    do,else,extends,false,final,finally,%
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    29
    for,if,implicit,import,match,mixin,%
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    30
    new,null,object,override,package,%
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    31
    private,protected,requires,return,sealed,%
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    32
    super,this,throw,trait,true,try,%
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    33
    type,val,var,while,with,yield},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    34
  otherkeywords={=>,<-,<\%,<:,>:,\#,@},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    35
  sensitive=true,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    36
  morecomment=[l]{//},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    37
  morecomment=[n]{/*}{*/},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    38
  morestring=[b]",
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    39
  morestring=[b]',
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    40
  morestring=[b]"""
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    41
}
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    42
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    43
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    44
\lstset{language=Scala,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    45
	basicstyle=\ttfamily,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    46
	keywordstyle=\color{javapurple}\bfseries,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    47
	stringstyle=\color{javagreen},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    48
	commentstyle=\color{javagreen},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    49
	morecomment=[s][\color{javadocblue}]{/**}{*/},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    50
	numbers=left,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    51
	numberstyle=\tiny\color{black},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    52
	stepnumber=1,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    53
	numbersep=10pt,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    54
	tabsize=2,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    55
	showspaces=false,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    56
	showstringspaces=false}
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    57
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    58
\lstdefinelanguage{while}{
222
b712519b41d3 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 218
diff changeset
    59
  morekeywords={if,then,else,while,do,true,false,write,upto,for,skip},
218
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    60
  otherkeywords={=,!=,:=,<,>,;},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    61
  sensitive=true,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    62
  morecomment=[n]{/*}{*/},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    63
}
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    64
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    65
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    66
\lstset{language=While,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    67
	basicstyle=\ttfamily,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    68
	keywordstyle=\color{javapurple}\bfseries,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    69
	stringstyle=\color{javagreen},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    70
	commentstyle=\color{javagreen},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    71
	morecomment=[s][\color{javadocblue}]{/**}{*/},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    72
	numbers=left,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    73
	numberstyle=\tiny\color{black},
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    74
	stepnumber=1,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    75
	numbersep=10pt,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    76
	tabsize=2,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    77
	showspaces=false,
8f3f8d82da8b added two new packages
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    78
	showstringspaces=false}