In my LaTeX document I have some source code. I want to color it to make it easy for understanding. Now there is a problem. I'm using the listings package from CTAN. The language is PHP.
Codes:
Code: Select all
Code, edit and compile here:
\lstdefinestyle{PHP}{otherkeywords={+,-,>,[,],\{,\},!,=,(,;,)},keywordstyle=\color{cgruen},stringstyle=\color{crot},commentstyle=\color{corange},identifierstyle=\color{cblau},moreemph={[3])},emphstyle={[3]\color{cgruen}}}\lstset{numbers=left,numberstyle=\tiny\sffamily\color{black},numbersep=2mm,backgroundcolor=\color{qcgrau},basicstyle=\scriptsize\ttfamily, linewidth=\textwidth, breaklines=true,xleftmargin=5mm, columns=fixed}\begin{lstlisting}[language=PHP,name=phppdf,caption={Ausgabe der Notenübersicht (gekürzt)},label=lst:phppdf,style=PHP]while($r = mysql_fetch_array($q)){$pdf->SetXY(30,$_y);$pdf->SetFont('Helvetica','B',10);$pdf->Cell($pdf->GetStringWidth($r['f_name']),5,$r['f_name']);$pdf->SetX(100);$pdf->SetFont('Helvetica','',10);$pdf->SetFillColor(190);$pdf->Cell(50,5,note($r['schnitt'],$r['klausur']),0,0,'C',1);$_y = $_y+10;}\end{lstlisting}
I hope you understand what i mean because my english isn't very well.
Anyone an idea?