Live data from Hacker News

Ask HN: Where are the good Markdown to PDF tools (that meet these requirements)?

news.ycombinator.com

1–10 of 58 posts

Ask HN: Where are the good Markdown to PDF tools (that meet these requirements)?

#1
I'm trying to convert a very large Markdown file (a couple hundred pages) to PDF.

It contains lots of code in code blocks and has a table of contents at the start with internal links to later pages.

I've tried lots of different Markdown-PDF converters like md2pdf and Pandoc, even trying converting it through LaTeX first, however none of them produce working internal PDF links, have effective syntax highlighting for HTML, CSS, JavaScript and Python, and wrap code to fit it on the page.

I have a very long regular expression (email validation of course) that doesn't fit on one line but no solutions I have found properly break the lines on page overflow.

What tools does everyone recommend?

Re: Ask HN: Where are the good Markdown to PDF tools (that meet these requirements)?

#3
post #2

Does converting to HTML first and then to PDF help?

This is what I have done for a couple of books I wrote in Markdown (https://deanebarker.net/books/).

Convert to HTML, then use Prince (https://www.princexml.com/) to style and convert to PDF.

Re: Ask HN: Where are the good Markdown to PDF tools (that meet these requirements)?

#5
It may be worthwhile to take a deeper look at Pandoc if other replies don’t respond with something easier.

In a recent Talk Python to Me podcast [0], the Quarto [1] developers talked about how they are using Pandoc’s Lua interpreter [2] to perform transformations that aren’t part of vanilla pandoc in.md -o out.pdf.

0. https://talkpython.fm/episodes/show/493/quarto-open-source-t...

1. https://quarto.org/

2. https://pandoc.org/custom-writers.html

Re: Ask HN: Where are the good Markdown to PDF tools (that meet these requirements)?

#7
I would love to read your feedback how it works with MonsterWriter.

1. Download the app [01] 2. Create a new empty document 3. Insert a markdown section type 4. past your markdown code into the markdown section 5. click on "Preview & Export" 6. Configure your PDF

I'm the creator of MonsterWriter. For complex markdown it probably has some shortcomings but I would love to hear what is missing for your use case.

[01] https://www.monsterwriter.com/

Post reply on HN