Code: Select all
\documentclass{book}
\usepackage[dvipsnames,table]{xcolor}
\usepackage{listings}
\begin{document}
%%%% Code 1 :
\lstset{
language=mathematica,
emph={[1]
x, y
},emphstyle={[1]\color{green}},
emph={[2]
u, v
},emphstyle={[2]\color{blue}},
emph={[3]
a, b
},emphstyle={[3]\color{red}}
}
\begin{lstlisting}[caption={Test},label={test}]
x, y,
u, v,
a, b,
\end{lstlisting}
%%%% Code 2 :
\lstset{
language=mathematica,
emph={[1]
u, v, a, b
},emphstyle={[1]\color{green}},
emph={[2]
x, y
},emphstyle={[2]\color{blue}}
}
\begin{lstlisting}[caption={Test},label={test}]
u, v, a, b,
x, y
\end{lstlisting}
\end{document}
What is wrong with this code ?

Here's a preview of what this code is doing : By the way, this new forum interface is HORRIBLE ! What was wrong with the previous interface ? it was perfect ! Why change something which was already great !?