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

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
sponsored
  1. obsidian-releases

    Community plugins list, theme list, and releases of Obsidian.

    It's not marketed as a markdown-to-pdf tool, but I've found that Obsidian (https://obsidian.md) does an excellent job. Just create a new "vault", paste your markdown into a new note, and export to PDF.

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. RL-book

    I worked on a [whole 500+ page book][1] in Pandoc that included a bunch of code samples, math, a table of contents with working links and an index. (In hindsight, I wish we had thought about the index from the beginning rather than adding it after the fact.)

    What worked well for me: Pandoc with a custom LaTeX template, and a decent amount of inline LaTeX to handle edgecases. We had a LaTeX theme to use from our publisher, but we also needed our own totally separate theme for the free version version of the book.

    For one-off things like really long code lines, I found it best to manually figure out how to handle them. Sometimes there was a bit of TeX magic but, more often, I just rewrote or reorganized the code. I see the presentation and structure of code and math snippets as an integral part of how I'm communicating the underlying ideas, so manually changing things around to read better was fundamentally no different from going back and editing prose.

    Unfortunately, this also means that the process was relatively hands-on. If you need something ≈completed automated, I expect Pandoc → LaTeX is going to fall a bit short. Edge cases need manual intervention, and it's easy for formatting errors to sneak in—the free version of our book has some formatting mistakes like code bleeding into the margin because I ran out of energy to fix all of them!

    [1]: https://github.com/TikhonJelvis/RL-book

  4. mdast-util-from-markdown

    mdast utility to parse markdown

    Have you explore the AST tools yet, like Mdast and the related remark and micromark?

    https://github.com/syntax-tree/mdast-util-from-markdown

    It might work better if you parse it into an intermediary format first, do whatever processing you need to implement "pages" (not a part of any Markdown dialect I'm familiar with?"), output that to HTML and THEN convert the HTML to PDF.

  5. typst

    A markup-based typesetting system that is powerful and easy to learn.

  6. dogx

    Documentation Generator X

  7. M.Sc.-Thesis

    Insieme's Haskell-based Analysis Toolkit

  8. paip-lisp

    Lisp code for the textbook "Paradigms of Artificial Intelligence Programming"

    I think Pandoc and Calibre could work for you.

    I've worked on PAIP, Paradigms of Artificial Intelligence Programming, and I might be able to help you a bit. It's around 1k pages long. I used Pandoc to generate an epub file, and then Calibre to turn that into a PDF file. I just tried using Pandoc to generate the PDF file directly, and it/LaTeX choked on some Unicode characters.

    For internal ebook links, there's a Lua script. You'll have to keep anchors unique across the book for this:

    * good: "chapter1#section1_1" and "chapter2#section2_1"

    * bad: a "chapter1#section1" and a "chapter2#section1"

    WIP: https://github.com/norvig/paip-lisp/pull/195

    For line wrapping of code, there's CSS. I first used it over on "Writing an Operating System in 1,000 Lines"; here's the PR: https://github.com/nuta/operating-system-in-1000-lines/pull/...

  9. operating-system-in-1000-lines

    Writing an OS in 1,000 lines.

    I think Pandoc and Calibre could work for you.

    I've worked on PAIP, Paradigms of Artificial Intelligence Programming, and I might be able to help you a bit. It's around 1k pages long. I used Pandoc to generate an epub file, and then Calibre to turn that into a PDF file. I just tried using Pandoc to generate the PDF file directly, and it/LaTeX choked on some Unicode characters.

    For internal ebook links, there's a Lua script. You'll have to keep anchors unique across the book for this:

    * good: "chapter1#section1_1" and "chapter2#section2_1"

    * bad: a "chapter1#section1" and a "chapter2#section1"

    WIP: https://github.com/norvig/paip-lisp/pull/195

    For line wrapping of code, there's CSS. I first used it over on "Writing an Operating System in 1,000 Lines"; here's the PR: https://github.com/nuta/operating-system-in-1000-lines/pull/...

  10. sveltedoc

    HTML+CSS to PDF attempt based on Svelte

    Whoa this is weird timing - just this weekend I did a little exploration of using Svelte to create documents and eventually PDFs.

    Its really just a proof of concept at this point, but it might be of interest to you (and others).

    Code: https://github.com/dominicdoty/sveltedoc

    Rendered: https://sveltedoc.pages.dev/

    Writeup: https://www.dominicdoty.com/2025/03/02/sveltedoc/

    TLDR -

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Build your plugins

    1 project | dev.to | 14 Nov 2026
  • Running Claude Code, Codex and Cursor Side by Side: How I Work With Them

    6 projects | dev.to | 11 Nov 2026
  • Mine and yours first Obsidian plugin

    1 project | dev.to | 8 Nov 2026
  • Notion vs Obsidian for Solo Work (2026): Cloud Workspace or Local Markdown?

    1 project | dev.to | 1 Nov 2026
  • What Obsidian Really Costs a Dev Team in 2026 (and 4 Ways to Sync a Vault)

    1 project | dev.to | 29 Oct 2026
Take the JavaScript Developer Survey About 6 minutes on the tools, libraries and AI you use with JavaScript. You get the results by email.
Take the survey

Did you know that JavaScript is
the 4th most popular programming language
based on number of references?