Forgive me for not making a PR, but I believe you will be able to code a better solution if this needs patching. The cause may be due to my bib file being dirty rather than this being a bug in the code!
However, I patched citeproc-bibtex2csl.lua:
- if bib_fields.eprint and string.lower(bib_fields.eprinttype) == "pubmed" and not item.PMID then
- item.PMID = bib_fields.eprint
To:
+ if type(bib_fields.eprinttype) == "string" then
+ if bib_fields.eprint and string.lower(bib_fields.eprinttype) == "pubmed" and not item.PMID then
+ item.PMID = bib_fields.eprint
+ end
+ else
+ item.PMID = ""
+ end
This will catch bib entries which fail when string.lower(bib_fields.eprinttype) it is of type/value nil not string. This solved an error in my tex document.
Describe the bug
Forgive me for not making a PR, but I believe you will be able to code a better solution if this needs patching. The cause may be due to my bib file being dirty rather than this being a bug in the code!
However, I patched
citeproc-bibtex2csl.lua
:To:
This will catch bib entries which fail when
string.lower(bib_fields.eprinttype)
it is of type/valuenil
notstring
. This solved an error in my tex document.