Bibliography path resolution not respecting leading `/`

Open
#12,553 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
cli

Research direction

Reproduce the issue with index.qmd, references.bib, and optionally _quarto.yml using the listed quarto render commands for html, typst, pdf, revealjs, and docx. Compare how the bibliography path is handled across formats; done means a leading /references.bib resolves consistently from the project and no format crashes.

Written by the indexing model from the issue text.

Description

bibliography bug

All formats but typst lead to a crash, regardless of the use of _quarto.yml

pandoc: /references.bib: withBinaryFile: does not exist (No such file or directory)
echo "---\nbibliography: /references.bib\n---\n" >index.qmd
touch references.bib
# touch _quarto.yml
for format in html typst pdf revealjs docx; do
  quarto render index.qmd --to ${format}
done
Quarto 99.9.9
[✓] Checking environment information...
      Quarto cache location: /Users/mcanouil/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.85.1: OK
      Deno version 1.46.3: OK
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      commit: 31e496fe384e1cb20caf709d6b2ab1dd5cce18b7
      Path: /Users/mcanouil/Projects/quarto-dev/quarto-cli/package/dist/bin

[✓] Checking tools....................OK
      TinyTeX: v2025.03.10
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/mcanouil/Library/TinyTeX/bin/universal-darwin
      Version: 2025

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /Applications/Brave Browser.app/Contents/MacOS/Brave Browser
      Source: QUARTO_CHROMIUM

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.13.1
      Path: /Users/mcanouil/Projects/quarto-dev/quarto-playground/.venv/bin/python3
      Jupyter: 5.7.2
      Kernels: julia-1.11, python3

[✓] Checking Jupyter engine render....OK

(\) Checking R installation...........ℹ R version 4.4.3 (2025-02-28)
! Config '~/.Rprofile' was loaded!
[✓] Checking R installation...........OK
      Version: 4.4.3
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/mcanouil/Projects/quarto-dev/quarto-playground/renv/library/macos/R-4.4/aarch64-apple-darwin20
        - /Users/mcanouil/Library/Caches/org.R-project.R/R/renv/sandbox/macos/R-4.4/aarch64-apple-darwin20/f7156815
      knitr: 1.50
      rmarkdown: 2.29

[✓] Checking Knitr engine render......OK
Discussed in https://github.com/quarto-dev/quarto-cli/discussions/12386

Originally posted by davidzgli March 26, 2025

Description
Description:

I've discovered a path handling inconsistency in Quarto when using bibliography paths across different output formats. Specifically:

  • When using the typst format, project-relative paths (starting with /) work correctly
  • When using the docx format, the same project-relative paths fail - absolute paths are required instead

This creates maintenance challenges when building documents for multiple output formats.

Minimal Working Example:
  1. Create a project with this structure:
my_project/
├── _quarto.yml
├── index.qmd
└── references/
    └── bibliography.bib
  1. Place this content in _quarto.yml:
project:
  output-dir: _output
  1. Place this content in index.qmd:
---
title: "Bibliography Path Test"
format:
  typst:
    bibliography: /references/bibliography.bib
  docx: 
    bibliography: /references/bibliography.bib
---

Testing bibliography paths.

Here's a citation [@doe2023].
  1. Create a minimal references/bibliography.bib file:
@article{doe2023,
  author = {Doe, John},
  title = {Example Article},
  journal = {Journal of Examples},
  year = {2023}
}
Steps to Reproduce:
  1. Create the above files in a new project
  2. Run quarto render index.qmd --to typst (works correctly with project-relative path)
  3. Run quarto render index.qmd --to docx (fails with project-relative path)
  4. Change the docx bibliography path to an absolute path like /home/username/my_project/references/bibliography.bib (works)
Environment information:
  • Quarto version: 1.5.57
  • Operating system: Rocky Linux release 9.5 (Blue Onyx)
  • R version: 4.4.2

Is this the expected behavior, or should project-relative paths work consistently across output formats?

Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quarto-dev/quarto-cli

All issues in quarto-dev/quarto-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.