# How to make my comments in the code grey in the latex doc?

I have to insert some mathematica code in my latex document. For that, I'm using the answer given here by user Ronny. Is it possible to add sth that would make my comments look grey in the resulting pdf document?

Thanks

You can use commentstyle=\color{gray}. Taking the code from answer linked by OP in the question:

\documentclass{article}
\usepackage{listings,framed,xcolor,amsmath}
\lstnewenvironment{mat}
{}

\begin{document}

\begin{align}
\nonumber W_{r     → ∞}=&-∫_{r}^{∞}\!F\,\mathrm{d}y=-    ∫_r^∞ \!     \dfrac{1}{4π\epsilon₀} \dfrac{q²}{\alpha²}     \dfrac{\alpha³}{y³}\left(1-    \dfrac{\alpha²}    {y²}\right)⁻²\,\mathrm{d}y\\
=&-\dfrac{1}{4π\epsilon₀} \dfrac{q²}{\alpha²}\alpha³     \underbrace{∫_r^∞     \! y⁻³ \left(1-\dfrac{\alpha²}    {y²}\right)⁻² \,\mathrm{d}y}_{I} \label{eq:WcondI}
\end{align}

Out[1]= {ConditionalExpression[$\displaystyle-\frac{1}{2(a²-r²)}$, Im[r]
Re[a] $≠$ Im[a] Re[r] || (( $a+r>0$ || $a+r ∉$ Reals) && ($a<r$ ||
$a-r ∉$ Reals) || $r ∉$ Reals )]} (* this is a comment *)