Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stroobandt opened this issue Feb 22, 2021 · 4 comments
Open

Comments

@stroobandt
Copy link

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
Copy link
Owner

jgm commented Feb 22, 2021

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?

jgm added a commit that referenced this issue Feb 22, 2021
besides "default".  (E.g. "info" which is used in zotero's
defaults.)

Partially addresses #57.
@stroobandt
Copy link
Author

stroobandt commented Feb 22, 2021

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

@stroobandt
Copy link
Author

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
Copy link

badumont commented Feb 23, 2021

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:

  • Convert to lowercase
  • Remove the following words: and et y und la le the l' d'
  • Remove the following characters: ! " # $ % & ' ( * ) + , . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ ;
  • Normalize spaces

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants