Convert a Jupyter notebook to PDF without LaTeX
You do not need LaTeX to turn a notebook into a PDF. The default jupyter nbconvert --to pdf path routes through XeLaTeX and forces a multi-gigabyte TeX install, but there are three LaTeX-free routes: nbconvert --to webpdf (renders through headless Chromium, no TeX, but needs a browser download), the plain browser print method (export to HTML, then Cmd/Ctrl+P → Save as PDF, zero installs), and a browser-based converter like PDFMoka's ipynb to PDF tool that does the HTML-render step for you and prints to PDF client-side. All three skip LaTeX entirely. Below is what each actually produces and when to reach for it.
Why the default path drags in LaTeX
--to pdf is not a direct converter. It first emits a .tex file, then calls XeLaTeX to typeset the PDF. That second stage is what needs a full TeX distribution (TeX Live, MiKTeX, or MacTeX), and it is why you can hit xelatex not found on PATH on a machine that has never had LaTeX. If you are seeing that specific error, the focused fix is in our nbconvert xelatex fix guide; if you simply do not want LaTeX in the first place, keep reading.
The important realization: LaTeX is only one of nbconvert's rendering backends. The notebook already contains everything as JSON, and rendering it as HTML then printing that HTML to PDF produces a perfectly good document, no typesetting engine required. All three methods below are variations on "render to HTML, print to PDF."
Method 1: nbconvert --to webpdf (no LaTeX, still command-line)
Best if you want to keep a scriptable command-line workflow but drop the TeX dependency.
pip install "nbconvert[webpdf]"
jupyter nbconvert --to webpdf notebook.ipynb
The [webpdf] extra installs Playwright, which drives a headless Chromium to render the HTML and print it to PDF. If Chromium is not already present you will see something like No suitable chromium executable found on the system; resolve it with one of:
# install the browser once
playwright install chromium
# or let nbconvert download it inline
jupyter nbconvert --to webpdf --allow-chromium-download notebook.ipynb
A genuinely useful flag for reports and homework: --no-input strips the code cells and keeps only outputs, so you can hand in a clean results document.
jupyter nbconvert --to webpdf --no-input notebook.ipynb
verify against current docs:
--to webpdf, the[webpdf]extra, and--allow-chromium-downloadare current in nbconvert 7.x. The webpdf exporter was introduced in the 6.x line; if you are on something older, checkjupyter nbconvert --help. Run the commands once on your machine before publishing.
Trade-off: you are trading a TeX install for a Chromium install. It is smaller and less painful, but it is not "zero setup."
Method 2: Export to HTML, then print from the browser (zero install)
The lowest-friction route, and it needs nothing beyond a browser you already have.
- In Jupyter (or JupyterLab), use File → Save and Export Notebook As → HTML (menu wording varies by version), or run
jupyter nbconvert --to html notebook.ipynb. - Open the resulting
.htmlfile in your browser. - Press Cmd+P / Ctrl+P, set the destination to Save as PDF, and adjust paper size and margins.
verify against current docs: the export menu path differs between classic Notebook, Notebook 7, and JupyterLab, and has been renamed across releases. Confirm the exact menu label in your install rather than trusting a fixed wording.
Honest limitations: this is manual (you cannot automate it in CI), you get less control over page breaks, and code lines that run past the page width can wrap or clip awkwardly depending on the browser. It is fine for a quick share; it is the weakest option for code-heavy notebooks with long lines.
Worth knowing: if you use VS Code with the Jupyter extension, its built-in "Export to PDF" uses a headless browser under the hood too, so it is effectively this same HTML-render approach with a nicer button.
Method 3: Browser-based converter (no install, handles the HTML step for you)
Methods 1 and 2 both boil down to "render the notebook as HTML, then print it." A browser-based converter just does that render step for you, so you skip both the Chromium install of Method 1 and the manual HTML-export dance of Method 2. Drop the .ipynb into PDFMoka's ipynb to PDF converter, preview it, and print to PDF.
Because the whole thing runs in your browser, the notebook is never uploaded to a server. That matters more than it sounds for notebooks: cell outputs routinely contain sample rows of real data, API responses, or file paths you would rather not send to a third-party service. Client-side conversion sidesteps that entirely.
This is the right pick when you have no working local toolchain, you are on a locked-down machine where you cannot install anything, or the notebook contains data that should not leave your device. It is not the pick for an automated pipeline, that is Method 1's job.
Side-by-side
| Method 1: webpdf | Method 2: browser print | Method 3: browser converter | |
|---|---|---|---|
| LaTeX needed | No | No | No |
| Any install | Chromium (via Playwright) | None | None |
| Scriptable / CI | Yes | No | No |
| Hide code cells | Yes (--no-input) |
No | Depends on tool |
| Data stays local | Yes | Yes | Yes (client-side) |
| Best for | automated, no-LaTeX pipelines | one-off quick share | no toolchain / sensitive data |
Which one?
- You script conversions or run them in CI, just not with LaTeX: Method 1 (
--to webpdf). - You want it now, one time, and will install nothing: Method 2 (browser print), accepting rougher code wrapping.
- No working toolchain, a locked-down machine, or data that shouldn't be uploaded: Method 3, convert the notebook in your browser.
A note on the LaTeX method itself: it is not obsolete. For academic submissions where reviewers expect LaTeX typesetting, or long text-heavy notebooks where hyphenation and line-breaking quality matters, the LaTeX pipeline still produces the best-looking output. This guide is about not being forced into it, not about never using it.
References
- nbconvert command-line usage (
--to webpdf,--no-input): https://nbconvert.readthedocs.io/en/latest/usage.html - nbconvert installation, "Installing Chromium" for webpdf: https://nbconvert.readthedocs.io/en/latest/install.html
- jupyter/notebook issue #3881 (request to print notebooks to PDF without LaTeX): https://github.com/jupyter/notebook/issues/3881