| name | quarto-render-and-debug |
| description | Preview, render, and troubleshoot Quarto projects. Use when the user asks to "render my Quarto document", "preview my slides", "debug a rendering error", "fix a cross-reference", "my PDF won't build", "quarto render fails", "install LaTeX", "fix missing package", "deploy my Quarto project", "publish to GitHub Pages", "speed up rendering", or needs help with any Quarto CLI command, rendering issue, LaTeX error, or publishing workflow.
|
Quarto Rendering, Preview, and Debugging
Preview, render, and troubleshoot all Quarto project types: documents, presentations, books, and websites.
Essential Commands
Preview (Live Reload)
quarto preview
quarto preview document.qmd
quarto preview --port 4321
quarto preview --no-browser
Preview watches for changes and auto-reloads. Use during authoring.
Render
quarto render
quarto render document.qmd
quarto render --to html
quarto render --to pdf
quarto render --to revealjs
quarto render --to docx
Multi-Format Render
quarto render document.qmd --to html,pdf
Diagnostics
quarto check
quarto --version
quarto inspect
quarto clean
PDF Rendering
LaTeX Engine
Quarto defaults to lualatex. Override in YAML:
format:
pdf:
pdf-engine: lualatex
Install LaTeX
quarto install tinytex
brew install --cask mactex
brew install --cask basictex
sudo apt-get install texlive-full
Missing LaTeX Packages
tlmgr search --file missing-file.sty
tlmgr install package-name
tlmgr update --all
Debugging PDF Builds
quarto render --to pdf --keep-tex
quarto render --to pdf --verbose
quarto render --to pdf --debug
Then examine _book/*.tex or the .tex file alongside your .qmd for LaTeX errors.
Common Errors and Fixes
Cross-References Showing "??"
Causes: Wrong label prefix, typo in reference, or missing label.
Fix:
- Verify label uses correct prefix:
#fig-, #tbl-, #eq-, #sec-, #lst-, #thm-
- Ensure the reference uses
@ syntax: @fig-label, @tbl-label
- Check for typos — labels are case-sensitive
- For books, ensure
crossref: chapters: true in _quarto.yml
- Try rendering twice (some cross-refs resolve on second pass)
Figures Not Displaying
Fix:
- Verify the image file exists at the specified relative path
- Check file extension matches exactly (case-sensitive on Linux)
- Use relative paths from the
.qmd file's location
- For PDF: use PNG, JPG, or PDF images (SVG requires conversion)
- Test with a simple image first to isolate the issue
"No LaTeX engine found"
quarto install tinytex
Or install a full TeX distribution (see Install LaTeX section above).
"Missing LaTeX package"
tlmgr install package-name
If you don't know the package name:
tlmgr search --file the-missing-file.sty
"Unicode character not set up for use with LaTeX"
Switch to lualatex or xelatex:
format:
pdf:
pdf-engine: lualatex
"Font not found"
format:
pdf:
mainfont: "Times"
sansfont: "Helvetica"
Or use LaTeX font packages with pdflatex:
format:
pdf:
fontfamily: libertinus
Citations Not Rendering
- Verify
bibliography: references.bib in YAML frontmatter
- Check the
.bib file exists at that relative path
- Ensure citation keys in text match keys in
.bib file
- Verify BibTeX syntax in the
.bib file (use a linter)
Code Execution Errors
python --version
pip list | grep jupyter
R --version
R -e "installed.packages()[,'Package']"
quarto render --execute
For persistent issues, use freeze:
execute:
freeze: auto
Book/Website Won't Render
- Validate YAML syntax:
python -c "import yaml; yaml.safe_load(open('_quarto.yml'))"
- Ensure all chapter/page files listed in
_quarto.yml exist
- Check Quarto version:
quarto --version (some features require 1.4+)
- Run
quarto clean then quarto render
Revealjs Slides Not Working
- Ensure
format: revealjs (not reveal or slides)
- Check that slide headings use
## (level 2)
- For speaker notes, press
S during presentation
- For PDF export, append
?print-pdf to the URL in browser
Performance Optimization
Freeze Computational Output
execute:
freeze: auto
Commit the _freeze/ directory to version control for reproducibility.
Cache Results
execute:
cache: true
Selective Rendering
quarto render --changed
quarto render chapter1.qmd chapter2.qmd
Publishing
Quick Deploy Commands
quarto publish gh-pages
quarto publish quarto-pub
quarto publish netlify
quarto publish connect
Manual Deploy
quarto render
Useful YAML for Debugging
format:
html:
keep-md: true
pdf:
keep-tex: true
keep-md: true
execute:
error: true
warning: true
message: true
Resources
references/error-messages.md — Comprehensive error message decoder with causes and solutions for LaTeX, cross-reference, citation, and rendering errors
references/publishing-workflows.md — Detailed deployment guides for GitHub Pages, Netlify, Quarto Pub, Vercel, AWS S3, and CI/CD setup