Friday, April 4, 2014

Displaying Highlighted Code in LaTeX/Beamer

It is possible to produce "automatically" highlighted code in LaTeX/Beamer using the "lstlisting" package. It supports a wide variety of languages, and one can control color-schemes, treatment of columns, tabs etc.

To produce the following Octave code,

I used the following LaTeX code: