jgm / citeproc

CSL citation processing library in Haskell
BSD 2-Clause "Simplified" License
152 stars 14 forks source link

--citation-abbreviations=FILE crashes on Zotero abbreviations.json #57

Open stroobandt opened 3 years ago

stroobandt commented 3 years ago
pandoc 2.11.4
Compiled with pandoc-types 1.22, texmath 0.12.1, skylighting 0.10.2,
citeproc 0.3.0.5, ipynb 0.1.0.1

The --citation-abbreviations=FILE option in Pandoc is incompatible in two ways with the following recent journal title abbreviation JSON file in the Zotero repository: https://raw.githubusercontent.com/zotero/zotero/master/resource/schema/abbreviations.json

  1. An "info" block at the beginning crashes citeproc.
{
    "info": {
        "URI": "http://www.zotero.org/abbreviations/default.json",
        "name": "MEDLINE + Title Word Abbreviations"
    },
    "default": {
        "container-title": {
            "academia peruana de cirugia": "Acad. Peru. Cir.",
CiteprocParseError: Could not parse abbreviations file https://raw.githubusercontent.com/zotero/zotero/master/resource/schema/abbreviations.json
Error in $.info.URI: parsing Map failed, expected Object, but encountered String
  1. Title word fallback with "container-title-word" is ignored. The word substitution rules are never applied. An example list can be found in the second part of the above mentioned JSON file.
        "container-title-word": {
            "aachener": "Aachen.",
            "aakkos-": "aakkos.",
jgm commented 3 years ago

I didn't know about word substitution rules (these are probably newer than our code for handling abbreviations, which is quite old). Is there comprehensive documentation of the abbreviations.json format somewhere?

stroobandt commented 3 years ago

@jgm Neither did I find any significant information about abbreviations JSON:

stroobandt commented 3 years ago

Being able to use more than one title abbreviation list at once, as suggested here, certainly makes sense in a setting of interdisciplinary studies.

badumont commented 3 years ago

There is no formal documentation about it, only some hints on the Zotero forum. The code starts from here.

Another incompatibility is that citeproc.js expects normalized strings for full titles in abbreviations.json. The rules are as follow:

So, to be matched, the title Jerusalem Studies in Arabic and Islam must be written jerusalem studies in arabic islam in the JSON file.

I am not sure that it is advisable to follow the same path. Or it could be proposed as an option.