Remove the annote
field from the data model
#220
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reviewing #218, I was looking into how
note
andannote
/annotation
are defined and used by CSL and BibLaTeX and learned that there are big discrepancies.TL;DR:
note
andannote
mean the reverse in CSL and BibLaTeX, CSL styles mostly use both as if there were no differenceLet's start by seeing what the CSL spec says about both:
Compare this with the BibLaTeX manual, section 2.2.2:
This shows that when going by spec, CSL's
annote
is most similar to the BibLaTeX fieldnote
and CSLnote
corresponds to BibLaTeX'sannotation
(also calledannote
in legacy BibTeX files). Personally, BibLaTeX's names make more sense to me. Additionally, ourinterop.rs
code did not take this difference into account, but do not worry: the CSL stylebibtex.csl
that converts a CSL entry to BibTeX code makes the same mistake.The problem?
Many CSL use the variables with their BibLaTeX semantics, some do a secret third thing. Use of the
note
variable is 3x as pervasive (31 styles) asannote
(10 styles).Most of the styles using
note
(American Journal of Sciences, ABNT, Bristol University Press, DIN 1505-2, many Harvard styles, Norma Portuguesa 405, Sorbonne, ...) violate the CSL spec by using it with its BibLaTeX meaning (short note). Some others, such as McGill and SPIE, use note as a fallback field to encode info specific to some entry types. In a unique use, The Pontifical Biblical Institute uses it to replace the issuance information of a publication completely (not unlike thenote
example in the BibTeX docs). I was only able to find the ISO 690 family of styles and Chicago Annotated using the field as intended by CSL, for narrative notes.Meanwhile, six styles correctly use the CSL
annote
field to provide a short note: Antarctic Science, Harvard Univ. of Bath, Society of Biblical Literature, United States International Trade Commission, Univ. Bern - Institut für Theaterwissenschaft, Zeitschrift für Theologie und Philosophie. None of them use it for the BibLaTeX meaning. The Catholic Biblical Association uses both fields in a custom way: thenote
field to describe a URL,annote
is used in another non-standard way: It replaces the citation completely with user-supplied text. This practice originated in this Zotero Forum thread and is also found in the styles of Society of Biblical Literature and the Tyndale Bulletin.The upshot
CSL authors are confused about the field's meanings. Implementing the data model and BibLaTeX conversions according to spec will yield confusing results and users will need to update their bibliographies depending on the style they use.
Additionally, in the context of Typst, implementing narrative bibliographies in Hayagriva only is a bad experience as Typst's formatting capabilities will be unavailable in any Hayagriva field (except for an escape hatch via math). Instead, Typst should allow printing a single bibliography entry manually, with the user entering their comments below.
The effect of this PR
This PR removes the
annote
field and gives thenote
field BibLaTeX semantics. Both BibLaTeX keys will be copied into Hayagriva'snote
, withnote
taking precedence overannotation
. In terms of CSL, both thenote
andannote
standard variables will yield the Hayagrivanote
fields. This aligns with what most styles expect.What breaks?
Most styles will work better after this is merged. However, this PR will break the following styles if
note
is present:annote
to replace the citations: Catholic Biblical Association, Society of Biblical Literature, and the Tyndale Bulletinnote
correctly as annotations (in the sense that the semantics of the field break, they are usable): the ISO 690 family of styles and Chicago Annotatednote
to provide fallback info for some types (e.g. interviews) such as SPIE and McGill