Replies: 2 comments 4 replies
-
|
Both pain points are known and have cleaner workarounds than three sequential renders. 1. Is the two-pass HTML render still necessary?Yes, when # _quarto.yml
execute:
freeze: autoCommit 2. A faster way to build both formats togetherThe root cause of Option A - change the output dir (recommended)project:
type: book
output-dir: _book # not docs
format:
html:
output-file: index.html
pdf: defaultThen publish to GitHub Pages via an Actions step that copies
Option B - keep
|
| Change | Time saved |
|---|---|
Commit _freeze/, drop HTML pass 2 |
~5–8 min |
Switch to output-dir: _book, single render |
~10–15 min |
| Combined | ~half of the current ~30 min build |
Beta Was this translation helpful? Give feedback.
-
|
@friendly as you are using an LLM, you can use it to mostly address your optimisation questions. Note also that Quarto CLI is indexed by deep wiki which could be used to get deeper knowledge of Quarto's internal.
Answer: yes, that's how books work at least in Q1, but this is internal.
Answer: There is something wrong here as I don't understand why would the PDF reference HTML pages here.
Freeze is for computation. If you don't have any, it does not matter. What would help us and you, would be to create a very small project such as one created with |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I'm working on a large Quarto book (~15 chapters) that produces both HTML (via GitHub Pages) and PDF (CRC Press). I am using Quarto 1.9.36 on Windows 11, R 4.5.2, RStudio 2026.04.0+526
Some chapters are online-only (HTML appendices, absent from PDF), implemented using Quarto profiles (
_quarto-online.yml,quarto-print.yml) as described in discussion #14365.My current build script (constructed by Claude) is at: https://github.com/friendly/Vis-MLM-book/blob/master/build.sh.
Because I want an author index in the PDF, it does a neat computation on the
@citationkeys to see if anything has changedbefore re-building that, and also offers a
--dry-runoption to see what would be done.It takes ~30 min to render both versions. I'm wondering if Claude's analysis of what happens with a simple
Build --> All formatsis correct, and whether mybuild.shscript can be made more efficient.How the script is organized
The script has three modes (
--html,--pdf,--all) built around one constraint: the two formats must be rendered separately, becausequarto render(all formats at once) fails on this book — during PDF cross-ref resolution it looks for.htmlfiles at the project root, but HTML output goes todocs/.For HTML, a two-pass render seems to be needed:
Pass 1 is necessary because
index.qmdis rendered before later chapters exist in the xref database, so forward cross-references (e.g.@sec-pca-biplot) show section titles instead of numbers. Pass 2 picks up the completed database and fixes them.For PDF, a single pass suffices, using the base config (no profile), which naturally excludes the online-only appendices:
A full
--allbuild therefore runs three complete renders sequentially:This takes ~25–30 minutes on my machine. The freeze cache speeds up partial
rebuilds (chapters whose source hasn't changed are skipped), but a full cold build
or one after editing a widely-used child doc still takes the full time.
Questions
Is the two-pass HTML render still necessary in current Quarto versions?
Is there a flag or config option that forces
index.qmdto wait for the full xref database before rendering, avoiding the second pass?Is there a faster way to build both formats with profile-based chapter exclusion?
For example, is there a way to run
quarto renderfor all formats at once that avoids the root-vs-docs/HTML path issue, perhaps via an output config option?Any other known strategies for cutting build time on large Quarto books?
(Beyond freeze cache, which we already use.)
Beta Was this translation helpful? Give feedback.
All reactions