Pandoc cannot make a PDF because pdflatex is missing
pdflatex not foundShort 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.
Fix it fast
1Find out which cause you have
Ask the shell whether the engine exists at all.
which pdflatex || echo "pdflatex missing" pandoc --version | head -n 12Match what you see, then jump to its fix
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 lualatex2Fix
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 texlive3Verify
pdflatex should now resolve, and a test conversion should write a PDF.
which pdflatex
pandoc input.md -o output.pdfConfirmed by pandoc.org
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 tectonic2Fix
Name an engine you have installed.
pandoc input.md --pdf-engine=typst -o output.pdf3Verify
The command should write output.pdf with no engine error.
ls -l output.pdfConfirmed by pandoc.org
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 fixServers
Ansible hangs, then times out waiting for the sudo prompt
a playbook using become seems to hang
Ansible ran sudo on the target and never saw the answer it expected.
3 causes, each with a fixServers
Apache on Ubuntu returns 404 Not Found for my site
The requested URL was not found on this server.
On Ubuntu a 404 from Apache usually means the request maps to a path that has no file.
3 causes, each with a fixServers
Apache returns 504 Gateway Timeout when PHP takes too long
Quick requests work, slow ones end in a 504 after a fixed wait
A 504 from Apache means the backend did not answer within the proxy timeout.
2 causes, each with a fixServers
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fixServers
Apache warns that a ${VAR} config variable is not defined
${VAR} left unchanged in the configuration, with a warning in the error log
Apache expands ${VAR} from Define or from the shell environment that exists when the server starts.
3 causes, each with a fix