0

By default listings adds black and white code. How can I make them colorful. Language I work on are -> Python, Mathematica, IDL.

1

1 Answer 1

1

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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .