By default listings adds black and white code. How can I make them colorful. Language I work on are -> Python, Mathematica, IDL.
1 Answer
So it is resolved. Use the following code to add color to comment, keyword, and strings of your script. I used for IDL, you can change the language and the color preference according to your style.
\lstset{language=IDL,
basicstyle=\ttfamily,
keywordstyle=\color{red}\ttfamily,
stringstyle=\color{magenta}\ttfamily,
commentstyle=\color{blue}\ttfamily,
morecomment=[1][\color{pink}]}{\#}
\lstinputlisting{codecurrentfree.pro}