A Typst project render cannot find the bibliography file in `output-dir`

Đang mở
#1,011 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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:

https://github.com/quarto-dev/q2/blob/a2a1cb948b1aec42c93200b880dc73567160f691/crates/quarto-core/src/pipeline.rs#L803-L813

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:

https://github.com/quarto-dev/q2/blob/a2a1cb948b1aec42c93200b880dc73567160f691/crates/quarto-core/src/transforms/resource_collector.rs#L466-L478

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.
Ngôn ngữ chính
Rust
Star
302
Fork
22
Merge trung bình
5 giờ 2 phút
Pull request đã merge (30 ngày)
213

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của quarto-dev/q2

Tất cả issue của quarto-dev/q2

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.