Markdown or LaTeX for a book: what you gain and what you give up

Use LaTeX if the book has serious mathematics, numbered cross-references or a layout you need to control to the point. Use Markdown for everything else — which is most books — because it reaches a well-set page in a fraction of the time and the file stays readable. Pandoc lets you write in Markdown and borrow LaTeX only where you need it.

The argument between these two is usually conducted by people who have only used one of them. Both are plain text, both are older than the web browser, both can produce a beautiful book, and they are good at almost entirely different things. The useful question is what your book actually needs, and the answer is usually clearer than the argument suggests.

What LaTeX is for

LaTeX is a typesetting system. Not a markup language that something else typesets — the typesetter itself, with forty years of accumulated knowledge about how to break a paragraph into lines, where to put a figure, and how to set an equation so a mathematician does not wince. Those are the things it is unmatched at.

  • Mathematics. Nothing else comes close, and nothing else is trying to. If the book has equations beyond the occasional inline formula, this is the deciding factor and the rest of the comparison is moot.
  • Cross-references. "See Figure 3.2" and "as shown in Section 4.1" resolve automatically, renumber themselves when you move things, and stay correct through a hundred drafts. Bibliographies and citations, through BibTeX, are the same story.
  • Paragraph and page breaking. LaTeX's line-breaking algorithm considers the whole paragraph at once and is still the standard others are measured against. Widows, orphans and rivers are handled by defaults that took decades to tune.
  • Control. Every dimension on the page is a variable you can set. If you need the running head 3.7 points lower on verso pages, you can have it.
  • Stability. A document written in 1995 still compiles. The format is not going anywhere.

What it costs

The costs are real, and they are paid by every book, not just the ones that need the power.

  • The toolchain. A full TeX distribution is several gigabytes. Installing it, keeping packages current, and getting the same output on a second machine are all tasks in themselves. Cloud editors remove the install and add a dependency on someone else's server.
  • The error messages. A missing brace on line 400 produces a wall of text pointing somewhere else. Experienced users learn to read it; new users learn to bisect their file by commenting out halves until it compiles. This is the single thing that stops most people.
  • The learning curve. The syntax is not hard. The *system* is — packages that conflict, defaults that are inherited from a 1980s printer, and a page geometry that has to be learned before it can be changed.
  • The file. A LaTeX manuscript is full of commands. It is readable, in the sense that you can see the words, but it is not readable in the sense of handing it to an editor who does not know the system. Markdown is.
  • Reflowable output. LaTeX thinks in pages. Getting a good EPUB out of it is possible and unpleasant. The formats that reflow were not part of the design.

What Markdown is for

Markdown is not a typesetting system and does not try to be. It is a way of marking structure — this is a heading, this is a list, this is emphasis — in a file that reads as plain prose. The typesetting happens elsewhere, in whatever renders it, and that is the whole trade: you give up control of the page in exchange for never having to think about it.

  • The file is the manuscript. Anyone can read it, edit it, diff it. It opens in any editor and will open in any editor in thirty years.
  • Nothing to install. Depending on the renderer, nothing at all. The toolchain is somebody else's problem, which is the correct owner for it.
  • One source, several outputs. The same file becomes a PDF and an EPUB without a second version, because the file describes structure and both formats understand structure.
  • Speed to a good page. With a renderer that has sensible book defaults, a well-set chapter is minutes away. The decisions that remain — typefaces, size, margins — are the six or so that actually matter.
  • It is what you already write in. Notes apps, wikis, documentation, README files. A book in Markdown is a book in the format the draft was probably in already.

The gaps are the mirror image of LaTeX's strengths. No native cross-references. No numbered figures. Mathematics only through extensions. No control over line breaking beyond what the renderer chooses to give you. And the notorious one: no page breaks, because there are no pages, which every renderer solves differently.

Side by side

LaTeXMarkdown
MathematicsUnmatchedExtensions only
Cross-references, citationsAutomaticBy hand, or via Pandoc
Line and page breakingBest availableRenderer's choice
SetupGigabytes, or a cloud editorNone to minimal
Time to a good pageDays the first timeMinutes
File readabilityWords visible, commands everywherePlain prose
PDFNativeVia a renderer
EPUBAwkwardNatural
Hand to an editorOnly a LaTeX-literate oneAnyone
Error messagesLegendaryRarely any

When you genuinely need LaTeX

Three cases, and they are specific.

  1. The book is mathematical. A textbook, a monograph, a thesis with real equations. There is no second option and you should not spend time looking for one.
  2. The book lives on cross-references. A technical reference with hundreds of numbered figures, tables and sections that refer to each other by number. Maintaining those by hand across drafts is not viable.
  3. The layout is the product. A book where the design is bespoke to the point — a critical edition, a book with marginalia, facing-page translations. You need every dimension as a variable, and LaTeX gives you that.

Notice what is not on the list: fiction, memoir, essays, business books, guides, workbooks, course material, programming books without heavy mathematics. That is most books, and for those the power is unused and the costs are paid anyway.

The hybrid

Pandoc converts Markdown to PDF *through* LaTeX, which gives you a third option: write in Markdown, and drop into LaTeX only for the paragraph that needs it. An equation, a specific page break, a custom title page. The rest of the file stays plain.

The proof follows from the identity

$
e^{i\pi} + 1 = 0
$

which we now apply to the general case.

\newpage

This is a good arrangement for a book with a little mathematics and a lot of prose, and it is where a lot of technical authors end up. The costs are that you now have the toolchain after all, that the raw LaTeX in the file is meaningless to any other renderer — the EPUB will print \newpage as text unless you guard it — and that the error messages come back the moment something goes wrong inside the LaTeX you dropped in. Pandoc for books goes through what that setup looks like in practice.

A way to decide

Count the equations. If there are more than a handful and they matter, LaTeX. Count the numbered cross-references you will need to maintain. If it is dozens, LaTeX or the hybrid. Otherwise, Markdown, with a renderer that handles the book-shaped problems — page breaks, tables across pages, embedded fonts, a cover, page numbers — so that you do not have to.

That last clause is the honest caveat on the Markdown side. Plain Markdown through a generic converter produces a web page printed to paper. Markdown through something that understands books — bukpress is one, Pandoc with a good template is another — produces a book. The format is only half the decision; the renderer is the other half, and five ways to convert Markdown to PDF sets out what each one gives you.

Read next

Tools · 4 min read

Pandoc for books: what it is superb at, and where it stops

Pandoc is the best tool available for documents with citations, cross-references or mathematics, and for any book whose production is automated by a build. It stops being the pragmatic choice when your requirements are visual rather than structural, because every visual change is made by writing LaTeX or a template.

Read it
Guides · 5 min read

Five ways to convert Markdown to PDF, and what each one costs you

There are five practical routes from a Markdown file to a PDF: printing from a browser or editor preview, a VS Code extension, an online converter, Pandoc with a LaTeX engine, or a hosted typesetting tool. They differ almost entirely in how much control you get over the page — and the page is the whole problem.

Read it
Explainers · 5 min read

Google Docs, Word or Markdown: what to write a book in

Write in Google Docs if other people need to comment on the draft while you write it, in Word if an editor or publisher will hand you tracked changes, and in Markdown if the same manuscript has to become several finished formats without being reformatted each time. Most people who finish books use two of the three, in sequence.

Read it

Write it in Markdown. Ship a book.

bukpress turns the file you are already writing into a typeset PDF and EPUB — your type, your covers, no watermark on any plan.

Start free — no card required