Generate a pdf from markdown, with an index, using a pdflatex hack.