Skip to content

Guide · Academic

LaTeX to EPUB and KDP, explained.

A LaTeX manuscript already makes a fine print PDF. Getting a clean ebook from it, with equations that work on Kindle and Apple Books, is the hard part. This guide gives the pandoc route, what breaks, and how LeafBound Academic imports a .tex book and its equations.

Checked 3 November 2026 against the pandoc manual and KDP’s file guidance. Whole-manuscript .tex import is in LeafBound Academic; see the last section for what it reads and what it skips.

Why LaTeX books are hard to turn into ebooks

LaTeX describes pages. An ebook has no pages: text reflows to the reader’s screen and font size, so page-based commands, fixed floats and hand-tuned spacing have nothing to attach to. Equations are the second problem. Print gets them from the TeX engine; an EPUB needs them as MathML, which not every reading app renders the same way.

The pandoc route

One command: pandoc book.tex -f latex -t epub3 --toc --toc-depth=2 --metadata-file=meta.yaml --epub-cover-image=cover.jpg -o book.epub
  1. Export to a plain structure

    Run pandoc on the main .tex file: it reads \chapter, \section, emphasis, lists, footnotes, simple tables, equations and included images. Resolve \input and \include first so one file holds the book.

  2. Write EPUB 3 with MathML

    Use the EPUB 3 writer so equations become MathML and footnotes become pop-up notes. Add a metadata file for title, author, language and cover.

  3. Validate

    Run EPUBCheck for validity and Ace by DAISY for accessibility. Fix missing alt text on figures and any heading-level jumps the converter produced.

  4. Preview on Kindle

    Open the EPUB in Kindle Previewer. Check an equation-heavy chapter on phone, tablet and e-reader sizes. Decide whether to add image fallbacks or publish print replica.

  5. Make the paperback from the PDF

    For KDP, set the trim size, margins by page count and bleed in your LaTeX class, embed fonts, and check the finished PDF against KDP’s rules before upload.

pandoc optionWhat it does
--toc, --toc-depthBuilds the navigation document from chapters and sections
--metadata-fileTitle, author, language, date, rights, cover
--epub-cover-imageCover image, which stores require
--mathmlThe default for EPUB 3; equations become MathML
--cssYour own stylesheet; keep it minimal so readers can override fonts and size
--citeprocResolves \cite with a CSL style when you have a bibliography file

What breaks, and what to do

LaTeX featureIn EPUB
Custom macros and class filesDropped or left as text. Expand macros in the source first, or define them in a header pandoc reads
TikZ, PGF and other drawn figuresNot converted. Render each to PNG or SVG with alt text and \includegraphics it
Complex tablesMerged cells and rules are flattened. Simplify, or supply an image with the data in a caption
Cross-references by pageMeaningless in an ebook. Refer to chapters and sections instead
BibliographyNeeds --citeproc and a .bib plus a CSL style; otherwise citations stay as keys
FootnotesBecome EPUB 3 pop-up notes; check them in the reader
Fonts and spacingIgnored by design; the reader controls them

Getting it onto Kindle

KDP takes the EPUB and converts it for Kindle devices and apps. Open the file in Kindle Previewer first and read an equation-heavy chapter at phone, tablet and e-reader sizes. Where equations do not render, you have two choices: add an image fallback with alt text for each equation, or publish the book as print replica, a PDF-based Kindle format that keeps the typeset page exactly and gives up reflow and screen-reader access. Say which you chose in the book description. See equations in print and ebooks for the reading-system matrix.

The paperback: LaTeX PDF to KDP

For print, LaTeX is at home. Set the page size to the trim (or trim plus bleed), the inside margin to KDP’s minimum for your page count, outside margins of at least 0.25 in (0.375 in with bleed), embed every font and flatten transparency. KDP prefers PDF/X-1a and accepts plain PDF. Check the finished file against the KDP paperback rules and the PDF/X guide before upload.

LaTeX import and equations in LeafBound Academic

LaTeX (.tex) import in LeafBound Academic reads the main .tex file with BibTeX, \input and \include, macros, equations, figures, tables and cross-references, and shows a review summary. It skips TikZ, \includepdf and some packages, so render those figures to images first, and a very large thesis takes a while to print. Check the result in the preview.

LeafBound Academic takes LaTeX for each equation, inline or displayed and numbered, sizes it from 25% to 400%, typesets it in the print PDF and writes MathML into every ebook edition, so screen readers can read it. Footnotes, citations (Chicago notes and bibliography, APA 7, IEEE or Vancouver) and a bibliography come from the same source library. A text that is not in LaTeX comes in through a Word (.docx), Markdown or plain text file, or by pasting; add equations where they belong.

Book settings Tools tab with equations, citations and source library, footnotes and commentary
The Academic tools: equations, citations, notes and commentary.

LaTeX questions

Can I upload a LaTeX book to KDP?

Yes, as a PDF for the paperback: KDP accepts any PDF, and prefers PDF/X-1a. Set the page size to your trim (with bleed if needed), the margins to KDP’s minimums for your page count, and embed every font. For the Kindle edition KDP wants an EPUB, which is where the conversion work is.

Does Kindle support MathML?

Partly, and it depends on the device and app. Amazon converts your EPUB to its own format and does not promise MathML rendering everywhere. Test the EPUB in Kindle Previewer and on a device; if equations are missing, provide an image fallback with alt text, or publish the math book as a print-replica PDF on Kindle, which keeps the typeset pages exactly.

What does pandoc lose from a LaTeX book?

Anything that is not plain structure: custom macros and class files, TikZ and PGF figures, complex tables, bibliographies without a pandoc filter, cross-references by page, and layout commands. It keeps headings, paragraphs, emphasis, lists, footnotes, simple tables, equations as MathML and images.

Can LeafBound import my whole .tex file?

Yes, in LeafBound Academic. LaTeX (.tex) import reads a .tex book with BibTeX, \input and \include, macros, equations, figures, tables and cross-references, then shows a review summary. It skips TikZ, \includepdf and some packages, so render those figures to images first, and a very large thesis takes a while to print. The equations stay editable as LaTeX: LeafBound typesets them in the print PDF and writes MathML into every ebook edition. Check the result in the preview and order a printed proof.

Which is better for a math book: reflowable EPUB or print replica?

Reflowable EPUB with MathML is accessible and resizes on phones, but equation rendering varies by reader. Print replica (a PDF-based Kindle format) keeps every page exactly as typeset but does not reflow and is not accessible to screen readers. Many textbook authors publish both: a paperback and reflowable EPUB for most readers, and note the limits in the description.

How do I keep footnotes when converting LaTeX to EPUB?

Pandoc turns \footnote into EPUB 3 pop-up notes if you write EPUB 3 (the default). Check them in Apple Books and Kindle Previewer. LeafBound exports footnotes as linked notes with backlinks in every ebook edition.

Typeset the equations, then export every edition.

LeafBound Academic writes the print PDF and six ebook editions from one source, with MathML in every ebook.

Early access · Author from $79 once · free 4-day trial · Windows 10 and 11