I'm trying to highlight my R code using minted package. However, after %, a few lines didn't get highlighted.
When I delete % problem disappears.
My code:
\documentclass{article}
\usepackage{minted}
\begin{document}
\begin{minted}{R}
> quantile(x_2, 0.75)
75%
270.745
> quantile(x_2, 0.25)
25%
105.35
> quantile(x_2, 0.75) - quantile(x_2, 0.25)
75%
165.395
\end{minted}
\begin{minted}{R}
> quantile(x_2, 0.75)
75
270.745
> quantile(x_2, 0.25)
25
105.35
> quantile(x_2, 0.75) - quantile(x_2, 0.25)
75%
165.395
\end{minted}
\end{document}


\begin{minted}[escapeinside=||]{R}and then replace all%by|\%|. This will give percent signs in black, though, but you can use\textcolorto achieve the correct color. – Οὖτις Mar 05 '23 at 08:21