I use the following settings for code listings. \usepackage{listings} \usepackage{textcomp} \lstset{language=Java, keywordstyle=\color{RoyalBlue}, basicstyle=\scriptsize\ttfamily, commentstyle=\color{Green}\ttfamily, rulecolor=\color{black}, upquote=true, numbers=left, numberstyle=\tiny\color{gray}, stepnumber=1, numbersep=8pt, showstringspaces=false, breaklines=true, frameround=ftff, frame=single
{{#tags}}- {{label}}
{{/tags}}