When using the package listing
, colorized comments will not yield colorized exotic unicode characters.
This is a minimal working example:
\documentclass{minimal}
\usepackage{
listings,
color,
fontspec
}
\setmainfont{Linux Libertine}
\lstset{
commentstyle=\color{green},
}
\begin{document}
\begin{lstlisting}[language=Java,showtabs=false]
// Comments are green, yet ‘•’ and ‘≤’ are not.
\end{lstlisting}
\end{document}
Colorizing these characters generally works within listing environments:
\lstset{
basicstyle=\color{green},
}
\begin{document}
\begin{lstlisting}[showtabs=false]
Everything is green, even ‘•’ and ‘≤’.
\end{lstlisting}
\end{document}
Is this a bug? How can I colorize the unicode characters within comments? I’m using TeXLive 2013 and lualatex.
\lst@ProcessLetter
first. See e.g. tex.stackexchange.com/a/25396/2388.^^^^20ac
. This is the input for the euro sign and reflects it unicode (U+20AC).^^^^2022^^^^2264
to the list and it worked fine. The symbols are now green.