A Typst project render cannot find the bibliography file in `output-dir`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start in crates/quarto-core/src/transforms/resource_collector.rs, where the issue says resource copies are collected from the document AST, and compare that with the flush-before-compile step in crates/quarto-core/src/pipeline.rs. Run the provided reproduction with citeproc: false and output-dir: _site; done means references.bib is available beside _site/index.typ and rendering produces _site/index.pdf.
由索引模型根据 Issue 内容生成。
描述
Bug description
In a project with output-dir: _site, a Typst document with bibliography: references.bib and citeproc: false fails on q2, and Quarto 1 renders it.
The generated _site/index.typ contains #bibliography(("references.bib")), but q2 never copies references.bib into _site, so typst compile cannot open it.
q2 already flushes the collected resource copies before the Typst compile step, which fixed the same failure for images:
The collector that builds those copies walks the document AST for image targets.
A bibliography: value sits in the metadata, so no copy is queued for it:
With citeproc: true the failure does not appear, because q2 resolves the citations itself and no #bibliography call is written.
The cause is my reading of the source.
The run confirms the missing file, and I have not checked that a queued copy fixes it.
Steps to reproduce
_quarto.yml:
project:
output-dir: _site
index.qmd:
---
format: typst
bibliography: references.bib
citeproc: false
---
[@a]
references.bib:
@book{a, title={A}, author={B}, year={2000}}
With q2:
q2 render
With Quarto 1:
quarto render
Actual behavior
q2 fails and leaves only _site/index.typ:
Error [Q-21-3]: typst compile exited with exit status: 1:
error: file not found (searched at /private/tmp/q2-typst.AqB0/_site/references.bib)
┌─ _site/index.typ:438:14
│
438 │ #bibliography(("references.bib"))
│ ^^^^^^^^^^^^^^^^^^
Quarto 1 writes _site/index.pdf.
Expected behavior
q2 copies references.bib next to _site/index.typ before it compiles, so _site/index.pdf is written, as in Quarto 1.
Your environment
- q2:
Q2 (quarto 2) 0.40.0-nightly.20261101(nightly built from a2a1cb9). - Quarto 1 for comparison: 1.12.0 (pre-release).
- OS: macOS 27.2 (arm64).
- Terminal, no IDE.
- 主要语言
- Rust
- 星标
- 302
- 派生
- 22
- 平均合并
- 5 小时 2 分钟
- 30 天内合并 PR
- 213
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quarto-dev/q2 的其他 Issue
-
`dir: rtl` isn't written to `<html>` in HTML output可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
quarto-dev/q2#1219 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
quarto-dev/q2#1188 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
quarto-dev/q2#1179 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
quarto-dev/q2#1133 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
quarto-dev/q2#1103 · 1 条评论 ·
维护者通常 1 天内回复