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 … > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1de89ee9-9064-4020-8419-4bcf7755cf9b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.