Zotero - Details on Field Codes/Bookmarks/Switch to Different Word Processor
Are there any details on how the field codes/bookmarks or switch to different word processor options are implemented? I'm happy if you point me to right spot to look in the github code.
For clarity, my ultimate goal is to use zotero with noamross/redoc (github repo), which is a way to create a Rmarkdown document that can be converted into a word document that retains markers for the various code blocks, such that it can be converted back to Rmd even after editing. It makes collaboration much better since no one who isn't already invested in all the technologies (i.e. your thesis supervisor) has to learn how to use different tools just so they can work with you, but it's still possible to take advantage of all of the nice literate programming tools available through R and Rmarkdown. I think there would be a huge advantage if the community was able to produce reports using reproducible literate programming methods with access to some sort of reference manager.
I've tested field codes/bookmarks/ZOTERO_EXPORTED_DOCUMENT in a simple document consisting of a single citation. It's easy to paste these into another (word) document and see that the other document imports the references well. The problems arise when you take a round trip through markdown.
Using pandoc: `pandoc -t docx+styles+empty_paragraphs doc_with_citation.docx -o doc.md`
- Field codes: I have no idea how to make this information accessible to pandoc
- Bookmarks: Pandoc does this weird thing where it deletes bookmarks if they aren't also linked to , so I created links to the bookmarks, but that didn't help when I converted the document back to docx
- ZOTERO_EXPORTED_DOCUMENT: looks the most promising and looks like it converts well to md and then back to docx. However, hitting "refresh" in the zotero toolbar says there are no citations to import. I've tried making the ZOTERO_ITEM_CSL (probably got that name slightly wrong) and the footer into links to https://www.zotero.org since that's what they were in the original document, but it seems like I'm still missing something.
I'm also aware of the RTF/ODT scan option --> that would be a good solution if noamross/redoc worked with OpenOffice, but it doesn't.
Does anyone know anything or know where these are documented/in the code?
Thanks a lot!
For clarity, my ultimate goal is to use zotero with noamross/redoc (github repo), which is a way to create a Rmarkdown document that can be converted into a word document that retains markers for the various code blocks, such that it can be converted back to Rmd even after editing. It makes collaboration much better since no one who isn't already invested in all the technologies (i.e. your thesis supervisor) has to learn how to use different tools just so they can work with you, but it's still possible to take advantage of all of the nice literate programming tools available through R and Rmarkdown. I think there would be a huge advantage if the community was able to produce reports using reproducible literate programming methods with access to some sort of reference manager.
I've tested field codes/bookmarks/ZOTERO_EXPORTED_DOCUMENT in a simple document consisting of a single citation. It's easy to paste these into another (word) document and see that the other document imports the references well. The problems arise when you take a round trip through markdown.
Using pandoc: `pandoc -t docx+styles+empty_paragraphs doc_with_citation.docx -o doc.md`
- Field codes: I have no idea how to make this information accessible to pandoc
- Bookmarks: Pandoc does this weird thing where it deletes bookmarks if they aren't also linked to , so I created links to the bookmarks, but that didn't help when I converted the document back to docx
- ZOTERO_EXPORTED_DOCUMENT: looks the most promising and looks like it converts well to md and then back to docx. However, hitting "refresh" in the zotero toolbar says there are no citations to import. I've tried making the ZOTERO_ITEM_CSL (probably got that name slightly wrong) and the footer into links to https://www.zotero.org since that's what they were in the original document, but it seems like I'm still missing something.
I'm also aware of the RTF/ODT scan option --> that would be a good solution if noamross/redoc worked with OpenOffice, but it doesn't.
Does anyone know anything or know where these are documented/in the code?
Thanks a lot!
This looks super interesting. I definitely need to convert a bunch of citations but I think it should work for what I need.
Since you seem familiar with `redoc`, I will also ask a follow-up question. Do you know if there is a good way to get a reversible document workflow with figures? If I try to roll my own with direct insertion of images I can get `redoc` to play nicely, but then I don't have a way to auto-generate a `\tableoffigures` either via Rmd or Word itself. If I use something like `pandoc-crossref` then I can use `\tableoffigures` but neither the generated table or the figures themselves play well with `redoc` in that case.
It seems like `make_wrapper` could be useful for this, but if I try hacky things like
+======example.Rmd=========
To force generation of an R codeblock, this doesn't get reversed well and the code block gets lost
redoc::dedoc(redoc::redoc_example_edited_docx())
And see. You are overthinking this I think. redoc already has all of these things worked out for you (that’s the point of it).
example.Rmd: And the dedoc of the docx produced by `render`ing the above `example.Rmd`:
I put up a minimal working example showing the various ways I have tried to insert figures in what I thought were sane ways and showing how redoc completely fails to deal with them well when dedocing.
From my investigations, it seems like redoc doesn't want to play well with images in general, but also not with features from pandoc-crossref such as \listoffigures
If you see something obvious that I am doing wrong, I'd love it if you can point me in the right direction, but I also know that this has probably already taken up too much of a stranger's time and kindness.
Cheers!
https://gist.github.com/erikli/f5676f7adb87c27bfe48acc616a74b03
What I see when I rmarkdown::render() and then redoc::dedoc() is here:
https://gist.github.com/erikli/9fb1bd17c3e0d389d18abf278fe509f2