A simple filter for pretty printing noweb code chunks,
using the minted
LaTeX package
- The
minted
LaTeX package noweb.sty
(comes with a noweb)- Pygments (tested on version 2.4.2, under Python 3.7)
- gawk
- Optional: GNU Make
Put the noweb-minted
and guessPygmentizeLexer.py
executables onto
your $PATH
, e.g.
ln -s "$PWD/noweb-minted" /usr/local/bin
ln -s "$PWD/guessPygmentizeLexer.py" /usr/local/bin
Use noweb as usual, but now with the noweb-minted
filter.
For instance, to generate sample.tex
, run make sample.tex
, i.e.
noweave -filter noweb-minted -delay -latex sample.nw >sample.tex
To generate sample.pdf
, run make sample.pdf
, i.e.
pdflatex --shell-escape sample.tex