Never mind, I installed the latest pandoc and got it to work.
So thanks for all your help. Now I just need to figure out how to another filter which removes the colon in this bibkey title
[@organization_endreport:_2016]
since the colon (which is part of the title) creates a syntax error with the following underscore.
Den fredag 3 november 2017 kl. 10:37:42 UTC+1 skrev Björn Ekström:
Hm, okay. Thanks. Although, both --lua-script and -lua-filter= gives
pandoc.exe: unrecognized option `--lua-[...]'
Den torsdag 2 november 2017 kl. 23:19:29 UTC+1 skrev John MacFarlane:
Nice! I hadn't even thought of having the lua filter
do the whole job.
+++ Albert Krewinkel [Nov 02 17 22:22 ]:
>This is such a beautiful solution that I couldn't resist to code up a
>proof-of-concept. The path to the bibtex file must be stored in the
>*bibliography* yaml field:
>
> ```
> bibliography: path/to/bibliography.bib
> ...
>
>fix-bibkeys.lua:
>
> function references_from_bibfile (filename)
> local yaml = io.popen('pandoc-citeproc -y ' .. filename):read("*a")
> return pandoc.read(yaml).meta.references
> end
>
> function Meta(meta)
> local bibfile = meta.bibliography[1].text
> local references = references_from_bibfile(bibfile)
> -- modify keys, replace ???? with 0000
> for k, v in pairs(references) do
> references[k].id = v.id[1].text:gsub("%?%?%?%?", "0000")
> end
> meta.references = references
> return meta
> end
>
>Run with
>
> pandoc --lua-filter=fix-bibkeys.lua --filter=pandoc-citeproc …