## TL;DR
nbconvert shells out to `xelatex` for PDF export, and `xelatex not found` means there is no TeX distribution installed or its binaries are not on the PATH of the environment running nbconvert. Install a full TeX distribution (TeX Live on Linux, MacTeX on macOS, MiKTeX on Windows), open a new shell, and confirm `which xelatex` prints a path. Then re-run the PDF export.

```text
jupyter nbconvert pdf failed: xelatex not found error
```

## Use this when
- PDF export fails immediately with `xelatex not found`.
- HTML export works but PDF does not.
- The machine is a fresh container or CI runner.

## Not for this skill when
- xelatex runs but the compile fails. That is a LaTeX error, not a missing binary.
- You want PDF without TeX. Use the webpdf exporter instead.

## Steps
1. Check for any TeX: `which xelatex pdflatex latex`. Verify: all empty, confirming nothing is installed.
2. Install a TeX distribution: `apt-get install texlive-xetex` on Debian/Ubuntu (or the full `texlive` scheme for regular use). Verify: the install completes.
3. Open a new shell and run `which xelatex`. Verify: it prints a binary path.
4. Re-run `jupyter nbconvert --to pdf nb.ipynb`. Verify: the PDF is produced.
5. If nbconvert runs in a different env (container, CI), install TeX there, not on your laptop. Verify: `xelatex` resolves inside that environment.

## Variant phrasings
### xelatex not found nbconvert
Short form. Install a TeX distribution.

### nbconvert pdf no latex installed
The cause phrasing. Same install.

### jupyter pdf export missing xelatex
UI phrasing. PATH or install.

Compatibility: nbconvert 6/7. The xelatex dependency is unchanged across versions.

## Why it happens
PDF-via-LaTeX is a two-stage pipeline: nbconvert renders .tex, then xelatex compiles it. The first stage needs only python; the second needs a multi-gigabyte TeX distribution that minimal containers and fresh machines never have. nbconvert does not bundle TeX, so the failure is environmental, and installing the distribution is the entire fix.

## Edge cases / pitfalls
- The minimal `texlive-xetex` package lacks many LaTeX packages notebooks use. Install the full scheme if compiles then fail on missing packages.
- Installing TeX on your laptop does not help a CI job. Match the install to the execution environment.
- TeX installs are huge (gigabytes). In containers, consider the webpdf exporter to avoid the weight.
- After installing, nbconvert processes started before the install may still have the old PATH. Restart them.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_SWp_Rw6APK9z_tpLTceDjg
