Skip to main content
Sphinx documentation can be converted to PDF through several methods. This guide covers the two most practical approaches:
  • Using Sphinx’s built-in LaTeX builder
  • Using the sphinx-simplepdf extension (Recommended)
Other tools exist for this task — rst2pdf, pandoc, sphinx-pdf-generate — but they are not covered here.

Method 1: Built-in LaTeX Builder

This method generates LaTeX source files from your Sphinx content and then compiles them into a PDF using a LaTeX distribution such as TeX Live (cross-platform) or MiKTeX (Windows).
You must have a LaTeX distribution installed before running this command. Without one, the build will fail with:
'latexmk' is not recognized as an internal or external command,
operable program or batch file.
make latexpdf
This generates LaTeX source files in the _build/latex directory and then attempts to compile them into a PDF. If you encounter Unicode character issues during compilation, set the latex_engine in your conf.py:
conf.py
latex_engine = "xelatex"  # or "lualatex"
xelatex and lualatex handle Unicode characters more gracefully than the default pdflatex engine.
The sphinx-simplepdf extension is more straightforward and user-friendly. It simplifies PDF generation and handles various content types more reliably than the LaTeX route.
pip install sphinx-simplepdf
sphinx-simplepdf depends on WeasyPrint. Follow the WeasyPrint installation guide for your platform before proceeding.
Add sphinx_simplepdf to the extensions list in conf.py:
conf.py
extensions = [
    # ... other extensions
    'sphinx_simplepdf',
]
Then build the PDF:
make simplepdf

Build docs developers (and LLMs) love