mvuorre / quarto-preprint

A Quarto extension for preprints using Typst
https://mvuorre.github.io/quarto-preprint/index.pdf
Creative Commons Attribution 4.0 International
34 stars 2 forks source link

Reference section is printed twice #24

Closed mvuorre closed 2 weeks ago

mvuorre commented 2 weeks ago

But only on some quarto/typst versions. Waiting for upstream fix?

danieltomasz commented 2 weeks ago

@mvuorre using Quarto 1.6 release candidate fixes this for me The workaround for quarto 1.5 was adding the following to the yaml (it wasn't supper reliable though)

citeproc: false
suppress-bibliography: true # Add issue about this

This was a known issue before due to fact how the citation is handled, maybe it is some regression https://github.com/quarto-dev/quarto-cli/issues/5560

mvuorre commented 2 weeks ago

Righto--this is why I wasn't seeing it on my end. Keeping this open for others to find but won't fix myself.

danieltomasz commented 2 weeks ago

@mvuorre I digged a bit deeper; quarto-wordcount invokes citeproc-like behavior even citeproc is false via pandoc lua filter https://github.com/mvuorre/quarto-preprint/blob/71bfa84705e9edb9dc95e2913b21696e3fe967be/_extensions/preprint/_extension.yml#L18

after adding suppress-bibliography: true in the template definition, the bibliography is printed only once an the word in the body of the article are counted correctly, so it doesn't influence wordcount: "{{< words-body >}}" (this could be added by the user in the yaml in qmd as well)

the citeproc is needed to count words included in bibliography, so the double reference section is the effect of both pandoc/qarto and typst handling bibliography;

mvuorre commented 2 weeks ago

I get it now. Thanks! I've fixed this but hopefully the suppress-bibliography: true hack won't be needed in the future.