quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.56k stars 293 forks source link

Typst `bibliographystyle: apa` loses "et al." abbreviation in in-text references after first appearance #10105

Open mvuorre opened 1 week ago

mvuorre commented 1 week ago

Bug description

I write a basic Typst document as follows

---
title: "Hello, Quarto"
format: typst
bibliography: bibliography.bib
bibliographystyle: apa
---

This should say et al @bolger2019.

This should say et al @bolger2019.

Which renders to

image

However, the second instance of the citation should also use the "et al." in-text citation abbreviaton, but instead writes out the names of all authors.

This Typst project shows the desired behavior:

image

Steps to reproduce

Full code to reproduce, including an example bibliography.bib file is at https://github.com/mvuorre/quarto-typst-reprex

Expected behavior

Both in-text citations should use "et al." abbreviaton.

Actual behavior

The second citation reads expands to all authors' names.

Your environment

Quarto check output

Quarto 1.5.47 [✓] Checking versions of quarto binary dependencies... Pandoc version 3.2.0: OK Dart Sass version 1.70.0: OK Deno version 1.41.0: OK Typst version 0.11.0: OK [✓] Checking versions of quarto dependencies......OK [✓] Checking Quarto installation......OK Version: 1.5.47 Path: /Applications/quarto/bin

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

[✓] Checking LaTeX....................OK Using: Installation From Path Path: /Library/TeX/texbin Version: 2024

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

[✓] Checking Python 3 installation....OK Version: 3.12.4 Path: /opt/homebrew/opt/python@3.12/bin/python3.12 Jupyter: (None)

  Jupyter is not available in this Python installation.
  Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK Version: 4.4.1 Path: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources LibPaths:

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

mcanouil commented 1 week ago

I'm not sure how's the issue is Quarto. You are using Typst built-in bibliography system: https://typst.app/docs/reference/model/bibliography/ Quarto does not do anything here. You can check keep-typ: true.

image

To me the issue is from Typst.

InputOutput
- Command ```sh quarto typst compile issue10105.typ ``` - `issue10105.typ` ````typ This should say et al #cite(, form: "prose");. This should say et al #cite(, form: "prose");. #set bibliography(style: "apa") #bibliography("bibliography.bib") ```` image
mcanouil commented 1 week ago

Workaround: use Pandoc citeproc as documented in https://quarto.org/docs/output-formats/typst.html#bibliography

mvuorre commented 1 week ago

Thanks! Perhaps there is a Typst version mismatch somewhere, then, because this works appropriately in the online Typst app: https://typst.app/project/w4lL8ljtKmp9tgR87kFZnj:

image

I think I will go with the citeproc workaround, even though that does not format the reference section appropriately either (no hanging indent):

image

Note; this latter issue is not due to https://www.zotero.org/styles/apa because that works well in other contexts:

image
mcanouil commented 1 week ago

Quarto does not use the latest. You can check the version being used with quarto check versions.

Note; this latter issue is not due to https://www.zotero.org/styles/apa because that works well in other contexts:

That's because this is Pandoc Citeproc handling CSL. Typst has its own system which does not work properly in the current version Quarto 1.5 embeds.

mcanouil commented 1 week ago

FYI, you can look at the changelog of the last release of Typst: https://github.com/typst/typst/releases/tag/v0.11.1

Fixed et-al handling in subsequent citations

I'm not sure Typst will be updated once more in 1.5. (cc @cscheid )

mvuorre commented 1 week ago

Ok, thanks!

gordonwoodhull commented 1 week ago

Confirmed, both the minimal Typst example and the .qmd produce the correct output with Typst 0.11.1 but not with Typst 0.11.0.

Unfortunately we are too late in the release cycle to update Typst for 1.5, but we will be sure to update it early in 1.6.

As a workaround, you could set QUARTO_TYPST=/path/to/typst0.11.1, but we haven't tested this configuration, so we can't support it.

mcanouil commented 1 week ago

@gordonwoodhull Thanks for confirming!

cscheid commented 1 week ago

You know, this is actually an argument that I'm wrong, and we should try fixing this in 1.5

cscheid commented 1 week ago

Closed by #10116.

cscheid commented 1 week ago

We can't take in 0.11.1 yet because of a cross-architecture bug (see #10157). Pushing to 1.6.

cscheid commented 1 week ago

There's an open bug on the Typst repo about this: https://github.com/typst/typst/issues/4242

cscheid commented 1 week ago

They've found the reason and have a fix. We should be able to take this very early into 1.6 and cleanly backport to the first stable 1.5 patch.