I have a .tex
file, actually it is from a certain layout of my university, and it comes with a .cls
file of its own. And now I have to create an appendix section contains only some Matlab codes. I have found an example latex code for Matlab code and as I guessed there is a .sty
file with it. Unfortunately as they have different document class, I could not merge them together. For example, in the .sty
file the coder has defined \lstdefinelanguage{matlabfloz}
, and in my main.tex
file coud not recognize it.
Here is my question, do I have to define that language in the .cls
file? Or there is some easier way without doing that?
(I tried to use \inputpdf
command, I do not have any error message afterwards, but it does not appear in compiled pdf which is I did not understand.)
\documentclass{article}
\usepackage[framed,numbered,autolinebreaks,useliterate]{mcode}
\appendix
\begin{document}
\begin{lstlisting}
for i = 1:3
if i >= 5 && a ~= b % literate programming replacement disp('cool'); % comment with some §\mcommentfont\LaTeX in it: $\mcommentfont\pi x^2$§ end [:,ind] = max(vec);
x_last = x(1,end) - 1;
v(end);
really really long really really long really really long really really long really really long line % blaaaaaaaa ylabel('Voltage (µV)');
end
\end{lstlisting}
\end{document}
.cls
-file. If I understand right your proiblem is that the commandlstdefinelanguage
is not defined. Have you included thelistings
package (\usepackage{listings}
) beforte you use it?listings
package. I guess the problem ismcode
package. It gives an error such as "Package Listings Error: language matlabfloz undefined." However when I openmcode.sty
file, I see a line\lstdefinelanguage{matlabfloz}
in it.mcode.sty
is normally does not exist in MiKTex installation files, so I added it myself manually.thesis.tex
file which is started\documentclass[chaparabic,ceng,ms,12pt,oneandhalf]{metu}
. here the{metu}
stands for the{metu}.cls
(I guess). I think I should change or add somethings in that{metu}.cls
file. @David Carlisle