I want to write a listing for python code. My problem, the zero by x = SUM('ZM_test'[testcol 0AN])
is in black fontcolor and not in green. My style settings for the listing looks like this:
\documentclass[12pt,a4paper]{report}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[left=4cm,right=3cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{listings}
\usepackage{color}
\definecolor{keywords}{RGB}{255,0,90}
\definecolor{comments}{RGB}{0,0,113}
\definecolor{red}{RGB}{160,0,0}
\definecolor{green}{RGB}{0,150,0}
\lstset{language=Python,
basicstyle=\ttfamily\footnotesize,
keywordstyle=\color{keywords},
commentstyle=\color{comments},
stringstyle=\color{red},
showstringspaces=false,
identifierstyle=\color{green},
%procnamekeys={def,class}
numbers=left,
xleftmargin=2em,
frame=single,
framexleftmargin=1.5em
}
\begin{document}
\begin{lstlisting}[language=Python, caption=xy, label=xy, numbers =left, frame= lines, gobble = 0]
x = SUM('ZM_test'[testcol 0AN])
y = SUM('ZM_test'[testcol bAN])
\end{lstlisting}
\end{document}
Do you know, why the zero has the fontcolor "black" and not "green"? I want the zero green like the "b" in y = SUM('ZM_test'[testcol bAN])
EDIT: That is not python code, but it should be the python style. Best regards Christian
You could try the approach from https://tex.stackexchange.com/a/42895