typst / hayagriva

Rusty bibliography management.
Apache License 2.0
350 stars 55 forks source link

Fix unnecessary disambiguation around ibids #250

Open MaxGietl opened 1 week ago

MaxGietl commented 1 week ago

Fixes https://github.com/typst/hayagriva/issues/129.

Disambiguation currently compares the normal render of a citation. This means that if two different citations both render to "ibid", they are disambiguated without actually being ambiguous. This PR solves that by creating a second render that disables ibids and using that for comparison.

Example:

First mention of Smith @smith[1].
Second mention of Smith @smith[2].

First mention of Mayer @mayer[1].
Second mention of Mayer @mayer[2].

Hayagriva disambiguates the citations, even though they aren't ambigous. 

#bibliography("bibliography.yaml", style: "deutsche-sprache")

bibliography.yaml

smith:
  type: article
  title: First article of Smith
  author: Smith
  date: 1990

mayer:
  type: article
  title: Article of Mayer
  author: Mayer
  date: 2010

Faulty render without this PR Screenshot 2024-11-20 154755

Correct render with this PR image

MaxGietl commented 1 week ago

These tests also fail on main currently, so I think this has nothing to do with my changes?

MaxGietl commented 1 week ago

@tsteckenborn Could you confirm this also fixes your issue or could you provide the files that caused this for you?

PgBiel commented 1 week ago

These tests also fail on main currently, so I think this has nothing to do with my changes?

Are you sure? I'd expect archive tests to fail as archive tests just compare the existing archive files with upstream CSL styles, but no citeproc tests are failing on main (at least, the CI check is green). Your PR might have triggered some unintended side-effects (would need further investigation).