I write a lot of teaching material on using coding languages. I have taken to using Markdown because it’s very easy to just get into it and mark up headings, tables and code samples.

The software I’m using on my Macintosh is Macdown. It’s good for what it does, but it’s developing some problems. It does, on the other hand, easily produce a PDF document, so again it is easy to get the job done.

However, the resulting document lacks many of the features I need to finish the job, including PDF bookmarks, a contents page, headers & footers, same-page foot notes and cross referencing.

Currently I run the PDF output through two other programs to generate PDF bookmarks and add primitive page numbering, but it’s very primitive and requires a lot of manual input.

Is there a tool or set of tools which will take a Markdown document and produce the above features? I would be happy to use Asciidoc instead, which I know has more features.

  • Maybe pandoc ? (I don't have experience with it, but it looks promising.)
    – user54131
    Apr 27, 2022 at 5:20
  • @towr As far as I’m aware, pandoc is more for converting different document types, which is what I would do if I end up using asciidoc. I think that includes, PDF, but I don’t think it does the other bits. I’ll have a look.
    – Manngo
    Apr 27, 2022 at 6:03
  • Yes, it's true it's more of a converter. But it converts to LaTeX which can do all those things, so maybe it can somehow do those things based on markdown. Page numbers seem to be default, and table of contents a matter of using --toc as commandline argument. Footnotes are also mentioned on this page about pandoc markdown
    – user54131
    Apr 27, 2022 at 6:26
  • Yes, pandoc represents more than half the hits on a Google search for "best markdown to pdf generator". It has tons of options. Here's a guide that I think does most of what you're asking: jdhao.github.io/2019/05/30/markdown2pdf_pandoc
    – Erk
    Apr 27, 2022 at 14:40


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.