Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

Pandoc cannot make a PDF because pdflatex is missing

Errorpdflatex not found

Short answer

Pandoc makes PDFs through LaTeX by default and calls pdflatex. If no LaTeX is installed, it stops. Install TeX Live with apt, or choose a different engine with --pdf-engine. Check with 'which pdflatex' and run the conversion again.

  • Applies to Pandoc 3.x, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask the shell whether the engine exists at all.

    which pdflatex || echo "pdflatex missing"
    pandoc --version | head -n 1
  2. 2Match what you see, then jump to its fix

    1. 1which pdflatex prints nothing.No LaTeX distribution is installedFix
    2. 2Disk space or install time rules out TeX Live.You want PDF without installing LaTeXFix

What does the error look like?

  • pdflatex not found

Cause 1 of 2

No LaTeX distribution is installed

1Check

By default Pandoc creates PDFs using LaTeX, so a machine without TeX Live cannot do it.

which pdflatex xelatex lualatex

2Fix

Install TeX Live from the package manager. The full texlive package is large; Pandoc's installation page names this one for Debian and Ubuntu.

sudo apt-get install texlive

3Verify

pdflatex should now resolve, and a test conversion should write a PDF.

which pdflatex
pandoc input.md -o output.pdf

Confirmed by pandoc.org

Did this fix it?

Cause 2 of 2

You want PDF without installing LaTeX

1Check

--pdf-engine accepts pdflatex, lualatex, xelatex, latexmk, tectonic, wkhtmltopdf, weasyprint, pagedjs-cli, prince, context, groff, pdfroff and typst. The chosen program must be installed and on PATH.

which typst weasyprint wkhtmltopdf tectonic

2Fix

Name an engine you have installed.

pandoc input.md --pdf-engine=typst -o output.pdf

3Verify

The command should write output.pdf with no engine error.

ls -l output.pdf

Confirmed by pandoc.org

Did this fix it?

How do I stop it coming back?

  • Put the TeX Live install in your server or container setup so PDF jobs do not fail on a fresh machine.
  • Pass --pdf-engine explicitly in scripts, so the engine does not depend on the default.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Servers

dnf cannot install MySQL on Amazon Linux 2023

dnf cannot find a mysql-server package on Amazon Linux 2023

Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.