Closed jctemp closed 1 month ago
This appears to be a problem with the default alphanumeric style we ship, which is pretty basic: https://github.com/typst/hayagriva/blob/a1a27dc6ac58ddde3b4deed3ab441619d9e2b25a/styles/alphanumeric.csl
An immediate workaround is to switch to the chicago-author-date
style instead.
One way to fix it would be to add disambiguate-add-year-suffix="true"
to <citation>
in the style, and then allowing the year suffix to be applied by adding <text variable="year-suffix" prefix="-"/>
to the citation <layout>
. However, that doesn't seem to work unless a <date>
, such as <date variable="issued" />
, is used, then we get "a" and "b" in the labels (although not in the bibliography entries, where the suffix gets added to the dates, which seems to comply with the CSL spec). Not sure if that (requiring a <date>
even when using a <text>
) is intentional or not, but I could see how the year-suffix might be ambiguous without knowledge of which date's year to use, so I think that's spec-compliant.
In general, the problem here, I think, is that we're using the citation-label
variable which doesn't work as a date, even though it (perhaps coincidentally) has a year. Some form of "global disambiguator" regardless of dates would be more useful here. Further investigation is needed to see if CSL has some avenue for this (I noticed that it allows checking for disambiguation in <choose>
, but not sure if this allows adding your own suffixes that aren't year-suffix
).
An immediate workaround is to switch to the chicago-author-date style instead.
Not exactly as the used citation label changes from [Abbrv+Year]
to (Author A, B et al. year)
. Morever, no links to the bibliography are provided if chicago-author-date
is used.
One way to fix it would be to add
disambiguate-add-year-suffix="true"
to<citation>
in the style
Maybe but one needs to disambiguate the labels on a level where author and year collide.
Some form of "global disambiguator" regardless of dates would be more useful here.
I agree. A collision is also possible with the workaround style if Author A, Author B and year match? Sadly, I don't know CLS defines the handling of these issues, e.g. appending a random suffix of length n to disambiguate all colliding references. A scholar had once the issue where he used up all suffixes and even BibLaTex errored. Maybe this insight is helpful to futher mitigate these extremes.
Description
Citing many papers in some work is unavoidable. Using the alphanumeric citation style causes the label of the corresponding reference to render identical. One cannot manually set the the suffix. Maybe one could query the number of references and perform a transformation based on the current context (but I don't know if this works).
The following has the Typst code and BibLaTex references. I also provided the comparison to LaTex behaviour as well as the used code to produce the output.
Current behaviour"
Expected behaviour:
Reproduction URL
https://typst.app/project/pvnJ3lO4BBYM0iaqwshID2
Operating system
Web app, Linux
Typst version