What is the best way of including Matlab code in a LaTeX document?

8,499

The listings package is very customisable. Might be worth looking into it:

https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings

Share:
8,499

Related videos on Youtube

Admin
Author by

Admin

Updated on February 19, 2020

Comments

  • Admin
    Admin over 3 years

    I know this is a popular problem. I have read that the matlab-prettifier package yields good results. My Editor told me, I am missing this package, though. I don't know how to download the package to ubuntu. Apparently, I have to do it manually.

    Anyways, are there any other ways? I have tried the Matlab publishing option. It generates a code, which is more or less just a \begin{verbatim} ... \end{verbatim}

    It is not in color.

    • jub0bs
      jub0bs over 6 years
      matlab-prettifier comes with most TeX distributions. You should be able to install it with whatever package manager you're using. If you post additional info about your system, we might be able to give you more guidance.