I want to include Matlab code in my document. The mcode package used to do a great job in combination with my scrbook document class. However, I recently updated my KOMAscript family to version 3.12 and now the mcode package causes an error (incomplete \iffalse). The errror only occurs when I \include a \chapter; not when I prevent the use of \include. The MWE below reproduces the error; the error disappears when I change scrbook into book. Can anyone help me solve the problem?
\begin{filecontents}{testchap.tex}
\chapter{matlab code}
\mcode{function}
\end{filecontents}
\documentclass{scrbook}
\usepackage{mcode}
\usepackage{filecontents}
\begin{document}
\include{testchap}
\end{document}
matlab-prettifierpackage instead ofmcode; see this answer. – jub0bs Mar 05 '14 at 21:01\documentclass{...}, the required\usepackage's,\begin{document}, and\end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – jub0bs Mar 05 '14 at 21:02\begin{document}, andend{document}. – Sander Mar 05 '14 at 21:15filecontentsenvironment before loading thefilecontentspackage? – jub0bs Mar 05 '14 at 21:20\chapteris enough. – David Carlisle Mar 05 '14 at 21:48mcodeseems not to be on CTAN. So, a link to it would have been useful. I want to link instead to Werner’s answer with a link: What can I use to typeset MATLAB code in my document?. – Speravir Mar 06 '14 at 02:46