Convert plaintext citekey to "live" MS Word citation
Hello everyone,
is there a way to convert the citekeys (or other plaintext references) of Better BibTeX into live citations fields in MS Word? I'm running into some collaboration issues now and am sorely missing a feature like this.
The existing discussions around the RTF scan functionality made me a little pessimistic already, but perhaps there was some development or add-on for this in the meantime.
Thanks!
is there a way to convert the citekeys (or other plaintext references) of Better BibTeX into live citations fields in MS Word? I'm running into some collaboration issues now and am sorely missing a feature like this.
The existing discussions around the RTF scan functionality made me a little pessimistic already, but perhaps there was some development or add-on for this in the meantime.
Thanks!
I'm drafting in a MD processor and want to include a citekey or plaintext ref which I want to have converted into a live MS Word citation when I copy the draft into word. Similarly, when collaborators use a different reference manager, we would agree on one citekey format and use that between files so I can also copy those drafts into MS Word to get the live citation to format with the Zotero MS Word plugin. I was hoping BBT came with some sort of such functionality as a unique citekey for each entry would be the first requirement.
Are you by chance an R user? If so, RStudio comes with pandoc built in, so you can convert Md files with no additional setup. Otherwise, I can walk you through the steps of using pandoc.
@bwiernik: Ah, that would be an option. Yes, I am an R user and going through the Md -> pandoc -> docx route would work, I suppose. I assume that I have to set up pandoc in a way that it recognises the BBT citekeys and turns them into Word citation fields? Anyways, thank you for the suggestion. I'll look into that!
It connects to BBT in Zotero. Soon it will have a function to scan your document for citekeys, then generate a bibliography (CSL JSON) file for the cited items
Otherwise, you can export your whole Zotero library to “Better CSL JSON”, then put this file into your YAML header at the top of your document.
The RTF/ODF scan part of the filter should work with the current BBT release, the Word part of the filter needs a patched BBT which I have on a branch.
yay I guess?
It should be fairly easy to make this work with RMarkdown. RMarkdown uses pandoc, and as it's a Lua filter, it should work as-is with any pandoc version > 5.2 (I think). It will filter out citations for which it can find all keys; citations where one or more keys cannot be found are passed through, as there are filters that (ab)use non-existing references to create cross-references within the doc. The filter will complain on stdout about mising keys -- it would be easy to spit those out as eg json so that an automated toolchain could do something with them.
I am getting the following error:
/Users/MYNAME/.pandoc/filters/zotero.lua:168:
module 'lunajson.sax' not found:
no file 'lunajson.sax.lua' in pandocs' datadir
no field package.preload['lunajson.sax']
no file '/usr/local/share/lua/5.3/lunajson/sax.lua'
no file '/usr/local/share/lua/5.3/lunajson/sax/init.lua'
(...and so on, various other missing files)
I was looking at this github page to try to figure out how to use (or 'install') a lua filter, and thought that putting it in the .pandoc/filters folder would do the trick, but it seems no. (FWIW, I created the .pandoc and the /filters folder myself, but that seems to be par for the course.)
For reference, the code I am running is:
/usr/local/bin/pandoc -s --lua-filter=zotero.lua
--filter=/usr/local/bin/pandoc-citeproc
--bibliography /zotero/my_library.bib
--csl /Users/MYNAME/.pandoc/chicago-fullnote-bibliography-with-ibid.csl
--reference-doc /Users/MYNAME/.pandoc/reference.docx -f markdown+smart
-t docx -o /Users/MYNAME/Desktop/"$title".docx "$@"
/usr/local/bin/pandoc -s
--lua-filter=zotero.lua
--reference-doc /Users/MYNAME/.pandoc/reference.docx
-f markdown+smart -t docx -o /Users/MYNAME/Desktop/"$title".docx "$@"