1

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?

strpeter
  • 5,215

1 Answers1

2

The first problem can be solved (I think it is a bug in the package mcode.sty) quite simply by adding a few lines of code just after including \usepackage[framed,numbered,autolinebreaks,useliterate]{mcode}:

\lstset{
    rulecolor=\color{black}
}

The problem at using mathematical formulas still remains.

strpeter
  • 5,215
  • Please consider accepting your own answer, so that it be removed from the pile of "unanswered" questions. – jub0bs Mar 18 '14 at 00:24