I'm trying to get green comments and blue javadocs.
But with this code I can't get blue javadocs, always I get all comments green:
\usepackage{color}
\definecolor{gray97}{gray}{.97}
\definecolor{gray75}{gray}{.75}
\definecolor{gray45}{gray}{.45}
\definecolor{red}{rgb}{0.6,0,0} % strings
\definecolor{green}{rgb}{0.25,0.5,0.35} % comments
\definecolor{purple}{rgb}{0.5,0,0.35} % keywords
\definecolor{blue}{rgb}{0.25,0.35,0.75} % doc
\usepackage{listings}
\lstset {
frame = Ltb,
framerule = 0pt,
aboveskip = 0.5cm,
framextopmargin = 3pt,
framexbottommargin = 3pt,
framexleftmargin = 0.4cm,
framesep = 0pt,
rulesep = .4pt,
backgroundcolor = \color{gray97},
rulesepcolor = \color{black},
%
stringstyle = \color{red},
showstringspaces = false,
basicstyle = \ttfamily\small,
commentstyle = \color{green},
morecomment = [s][\color{blue}]{/**}{*/},
keywordstyle = \color{purple}\bfseries,
%
numbers = left,
numbersep = 15pt,
numberstyle = \tiny,
numberfirstline = false,
breaklines = true,
}
I use this code to print the code example:
\begin{lstlisting}[language=C]
/* Includes */
#include <stdio.h>
int main(int argc, char* argv[]) {
puts("Hola mundo!"); // Text console
}
\end{lstlisting}
In that can I be wrong? Thanx