Created
April 20, 2024 19:16
-
-
Save mxpiotrowski/0e7d26980db8554b62ca61a476adc958 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Time-stamp: <2024-04-20T21:07:41+0200 mpiotrow> | |
--[[ When converting from biblatex to bibtex, Pandoc only considers | |
URL fields: DOIs get lost in the conversion (see | |
<https://github.com/jgm/pandoc/blob/main/src/Text/Pandoc/Citeproc/BibTeX.hs>). | |
This filter copies the values of DOI fields to URL fields, so that | |
they are output to bibtex. ]] | |
function Pandoc(d) | |
refs = pandoc.utils.references(d) | |
local i, entry = next(refs, nil) | |
while i do | |
if refs[i].DOI then | |
refs[i].URL = "https://doi.org/" .. refs[i].DOI | |
end | |
i, entry = next(refs, i) -- get next index | |
end | |
d.meta.references = refs | |
return d | |
end |
I agree, but I needed a solution now ;-) The change would be trivial, but I’m not building Pandoc from source, so I can’t make a PR, just add another enhancement request to the 1000+ issues…
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shouldn't this be fixed in Pandoc directly instead?