I have an issue with no all my R comments being colored in my latex file. I am using the listing package. My pre-amble code is
\lstset{ %
language=R,
basicstyle=\footnotesize,
numbers=left,
numberstyle=\tiny\color{gray},
stepnumber=1,
numbersep=5pt,
backgroundcolor=\color{white},
showspaces=false,
showstringspaces=false,
showtabs=false,
frame=false,
rulecolor=\color{black},
tabsize=2,
captionpos=b,
breaklines=true,
breakatwhitespace=false,
keywordstyle=\color{black},
commentstyle=\ttfamily\color{green!60!black},
escapeinside={\%*}{*)},
morekeywords={*,...}
}
We include R code with comment (denoted by #) the green coloring appear to not include special characters (specifically, $)
Calling my code by
\lstinputlisting{R_script.R}
xcolorpackage, and the the$do appear but in black only. That is at least what I could reproduce. You may also consider moving this to tex.stackexchange - it's, in my view, more of a LaTeX question than a R issue. – vaettchen Jun 25 '15 at 05:56