A simple filter for pretty printing noweb code chunks using the LaTeX minted package
- The
minted
LaTeX package - Pygments. So far, the code is tested on version 2.0.2, under Python 2.7.
- The
gawk
executable. I installed this using homebrew on OSX.
Put the noweb-minted
and guessPygmentizeLexer.py
executables into your PATH. For instance:
ln -s /path/to/noweb-minted/noweb-minted /usr/local/bin
ln -s /path/to/noweb-minted/guessPygmentizeLexer.py /usr/local/bin
Use noweb as usual, but now with the noweb-minted
filter. For instance, to generate thesample.tex
do the following:
> noweave -filter noweb-minted -delay -latex sample.nw > sample.tex
> pdflatex --shell-escape sample.tex
The output should be the same as in sample.pdf
.