From 33c0df1c83881f59005ef558dfbda6afec75ba9e Mon Sep 17 00:00:00 2001 From: David Radice Date: Tue, 28 Sep 2021 14:29:37 -0400 Subject: [PATCH] Set doctype to article when generating the bibtex The doctype returned by iNSPIRE is not compatible with bibtex. As a workaround we set the doctype to "article" for everything. --- fillbib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fillbib.py b/fillbib.py index bba966c..c4c2378 100755 --- a/fillbib.py +++ b/fillbib.py @@ -73,7 +73,7 @@ def inspire_citation(key, return bib.replace(inspire_key, key) metadata = data['hits']['hits'][0]['metadata'] - doctype = metadata["document_type"][0] + doctype = "article" # metadata["document_type"][0] # BibTeX entry as a dictionary bibtex = {} @@ -154,7 +154,7 @@ def inspire_citation(key, s = "@{}{{{}".format(doctype, key) for field, value in bibtex.items(): s += ",\n {} = \"{}\"".format(field, value) - s += "\n}" + s += "\n}\n" return s