While using mcode.sty, I recognized that at linebreaks with long comments parts of the surrounding frame got colored green or were even left white at using mathematical formulas, e.g. in the following example:
\documentclass{article}
% load package with ``framed'' and ``numbered'' option.
\usepackage[framed,numbered,autolinebreaks,useliterate]{mcode}
% something NOT relevant to the usage of the package.
\setlength{\parindent}{0pt}
\setlength{\parskip}{18pt}
\begin{document}
\begin{itemize}
\item The following demo block shows the problems:
\begin{lstlisting}
for i = 1:3
if i >= 5 % literate programming replacement
disp('cool'); % comment with some §\mcommentfont\LaTeX in it: $\mcommentfont\pi x^2$§
end
really really long really really long really really long really really long really really long line % blaaaaaaaa
end
\end{lstlisting}
\end{itemize}
\end{document}
How can uniformly black colored frames be achieved?
itemize) in your code. The problem only seems to occur in a list, if you remove the\itemfrom your code everything works fine. – Torbjørn T. Feb 13 '13 at 19:53lstlisting-environment. – strpeter Feb 15 '13 at 08:17mcodepackage, but also occurs with thelistingspackage (whichmcodeis built on). – jub0bs Feb 27 '14 at 11:09matlab-prettifierpackage; see this answer. – jub0bs Mar 18 '14 at 00:25