Deine Frage ist zwar schon etwas her, aber aus gegebenem Anlass und weil ich selber sowas machen und es später nachschlagen will:
Package : listings
Sprachen: C, C++, Java, VHDL, Ada, Fortran, HTML, Mathematica, Pascal, Perl, Python..
|
Source code
|
1
2
3
4
5
6
7
8
9
|
\usepackage{listings, color}
\lstset{language=Java}
%numberstyle=\tiny,
\lstset{tabsize=1,numbers=left}
\definecolor{lgray}{gray}{0.90}
\lstset{backgroundcolor=\color{lgray}}
\lstinputlisting[caption=HelloWorld in Java,label=hello world]{HelloWorld.java}
|
Das sieht auch schon gar nicht so schlecht aus, oder?