Thursday, November 25, 2010

Matlab codes in Latex

Use the package (mcode.sty) from:
http://www.mathworks.com/matlabcentral/fileexchange/8015-m-code-latex-package
add:
\usepackage[options]{mcode}
in the "header"
follow:
http://my.opera.com/locksley90/blog/2008/02/25/how-to-include-matlab-source-code-in-a-latex-document

Here is what I did:

This creates a box, pushes everything inside the box (ugly though) and forces next item to new page
\lstinputlisting[label=lst:run_main,breaklines=true, caption={\mcode{run_main.m}}]{G:/academy/random-s-circle/jan14-refine/run_main.m}
\clearpage 

No comments: