DOCX -> MD -> DOCX while keeping Zotero embedded / live citations intact #2862
-
I'm collaborating with a number of people who use MS Word, with a shared Zotero library. I've requested them to add citations to the DOCX files using Zotero (i.e., live / embedded citations, rather than plain text citations). This DOCX file also has comments and tracked changeds. I can convert this to Markdown using:
However, when I do so, the I've had a look at https://retorque.re/zotero-better-bibtex/exporting/pandoc/ but that seems to require the citekey. Thus I'm having difficulty figuring out how to export the edited Markdown file back into a DOCX file with the Zotero live citations intact. Any help would be appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 19 replies
-
It doesn't look like the pandoc AST retains all relevant information. If you unzip the docx you'll see that the citations have, ao, the
|
Beta Was this translation helpful? Give feedback.
-
But given that Zotero is used by very many people who use Pandoc for
scholarly writing, I think a case can be made to retain extra information
in the AST, which specific writers and lua plugins can choose to use or not
use.
I'll open an issue with Pandoc and check if @jgm is willing to add this to
the AST. I feel it would really help.
Thanks, Emiliano!
…On Thu, 2 May 2024 at 14:17, Emiliano Heyns ***@***.***> wrote:
If I understood you correctly, if Pandoc includes the citationItems.uris
and the citationID, then you'd be able to ensure round-tripping of the
Zotero live citations?
Either one will do, but these are likely Zotero-specific, and the pandoc
AST is meant to be generic.
—
Reply to this email directly, view it on GitHub
<#2862 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXQE6GSR4FNFRDTCOGQL5DZAH4QLAVCNFSM6AAAAABHCFNBFCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TEOJTGA2TQ>
.
You are receiving this because you authored the thread.Message ID:
<retorquere/zotero-better-bibtex/repo-discussions/2862/comments/9293058@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
Changes to the pandoc AST are big and messy and we avoid them at all costs. I note that the pandoc data structure contains a citationHash field which was used in the early pandoc-citeproc library but isn't used any more by pandoc or citeproc. In principle one could stuff the URI into this, but it seems...unprincipled. |
Beta Was this translation helpful? Give feedback.
-
Feel free to put up an issue on pandoc for this. I'll ponder it further but you shouldn't expect anything to change in the near future. |
Beta Was this translation helpful? Give feedback.
-
Wow. Thanks, @retorquere. I'm currently at an airport. I'll try out the lua
filter once I'm in front of my laptop, and will let you know.
…On Fri, 3 May, 2024, 12:45 Emiliano Heyns, ***@***.***> wrote:
@jgm <https://github.com/jgm> @the-solipsist
<https://github.com/the-solipsist> this script does what I proposed above
pandoc would do natively.
—
Reply to this email directly, view it on GitHub
<#2862 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXQE6A4SOII24Z75AHOV2LZANTETAVCNFSM6AAAAABHCFNBFCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TGMBUGM4DO>
.
You are receiving this because you were mentioned.Message ID:
<retorquere/zotero-better-bibtex/repo-discussions/2862/comments/9304387@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
Hi. I'm sorry for the delay in getting back. That lua filter didn't work for me, unfortunately.
Without
With
So with |
Beta Was this translation helpful? Give feedback.
Oh, you want it resolved on the Zotero item key in the document. Those aren't made available in the AST the Lua filter gets, so that doesn't appear to be possible. It should be possible by eg parsing the document XML using python or somesuch to restore the citation keys as the citation ID, and then it could be put through pandoc.