1 \usepackage{xcolor,listings}
2 \definecolor{mygreen}{rgb}{0,0.6,0}
3 \definecolor{mygray}{rgb}{0.5,0.5,0.5}
4 \definecolor{mymauve}{rgb}{0.58,0,0.82}
7 backgroundcolor=\color{white}, % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}
8 basicstyle=\scriptsize\ttfamily, % the size of the fonts that are used for the code
9 breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
10 breaklines=false, % sets automatic line breaking
11 captionpos=b, % sets the caption-position to bottom
12 commentstyle=\color{mygreen}, % comment style
14 deletekeywords={...}, % if you want to delete keywords from the given language
15 escapeinside={\!*}{*!}, % if you want to add LaTeX within your code
16 %escapeinside={||}{||}, % if you want to add LaTeX within your code
17 extendedchars=true, % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
18 %frame=single, % adds a frame around the code
19 frame=leftline, % adds a frame around the code
20 identifierstyle=\ttfamily,
21 keepspaces=true, % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
22 keywordstyle=\color{blue}, % keyword style
23 language=Java, % the language of the code
24 morekeywords={*,...}, % if you want to add more keywords to the set
25 numbers=left, % where to put the line-numbers; possible values are (none, left, right)
26 numbersep=5pt, % how far the line-numbers are from the code
27 numberstyle=\tiny\color{mygray}, % the style that is used for the line-numbers
28 rulecolor=\color{black}, % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
29 showspaces=false, % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
30 showstringspaces=false, % underline spaces within strings only
31 showtabs=false, % show tabs within strings adding particular underscores
32 stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered
33 stringstyle=\color{mymauve}, % string literal style
34 tabsize=2, % sets default tabsize to 2 spaces
35 %title=\lstname % show the filename of files included with \lstinputlisting; also try caption instead of title