I need to include a bunch of Matlab code in my report, and found a template for
\lstset
settings using Google (see code in the end of the post). I then added the breaklines=true
in order to avoid problems with long lines. The thing is though, that it keeps writing "breaklines" every time it breaks a line (it literally writes it in letters in the document). I have looked everywhere for help, but can't find anyone who had this issue before. Am I completely retarded?Hope you can help, thanks.
- Jake
Code: Select all
Code, edit and compile here:
\lstloadlanguages{Matlab}\lstset{language = Matlab, % Use MATLABbasicstyle = \small\ttfamily, % Use small true type fontkeywordstyle = [1]\color{Blue}\bf, % MATLAB functions bold and bluekeywordstyle = [2]\color{Purple}, % MATLAB function arguments purplekeywordstyle = [3]\color{Blue}\underbar, % User functions underlined and blueidentifierstyle =, % Nothing special about identifiers%% Comments small dark green couriercommentstyle = \usefont{T1}{pcr}{m}{sl}\color{MyDarkGreen}\small,stringstyle = \color{Purple}, % Strings are purpleshowstringspaces = false, % Don't put marks in string spacestabsize = 5, % 5 spaces per tab%%%% Put standard MATLAB functions not included in the default%%% language heremorekeywords={xlim,ylim,var,alpha,factorial,poissrnd,normpdf,normcdf},%%%% Put MATLAB function parameters heremorekeywords=[2]{on, off, interp},%%%% Put user defined functions heremorekeywords=[3]{FindESS, homework_example},%morecomment = [l][\color{Blue}]{...}, % Line continuation (...) like blue commentnumbers = left, % Line numbers on leftfirstnumber = 1, % Line numbers start with line 1numberstyle = \tiny\color{Blue}, % Line numbers are bluestepnumber = 5 % Line numbers go in steps of 5breaklines = truebreakatwhitespace = falseprebreak = \spacepostbreak = \space}