Skip to content

Commit 2d09680

Browse files
committed
Add url entry to bibtex
Addresses #499.
1 parent ecbc213 commit 2d09680

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

scholarly/publication_parser.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,11 @@ def bibtex(self, publication: Publication) -> str:
402402
publication = self.fill(publication)
403403
a = BibDatabase()
404404
converted_dict = publication['bib']
405+
try:
406+
url = publication['eprint_url']
407+
except KeyError:
408+
url = publication.get('pub_url', '')
409+
converted_dict['url'] = url
405410
converted_dict = remap_bib(converted_dict, _BIB_REVERSE_MAPPING)
406411
str_dict = {key: str(value) for key, value in converted_dict.items()}
407412
# convert every key of the dictionary to string to be Bibtex compatible

0 commit comments

Comments
 (0)