Thanks for the additional suggestions. I ended up writing a rough filter that works for my simple example: https://github.com/aringeri/pandoc-citation-linking/blob/main/app/Main.hs - The export from markdown to docx requires the better bibtex filter: https://github.com/retorquere/zotero-better-bibtex/blob/master/pandoc/pandoc-zotero-live-citemarkers.lua - Once the docx file is created, open it up in word and hit the 'refresh zotero' button, then my filter above should be able to recover the original citation keys. I'm not too sure this is the idiomatic way of doing it in pandoc. I'm sure I will develop on this as I figure out my workflow. It's good to know that pandoc is very customizable. On Saturday, November 11, 2023 at 8:15:55 AM UTC+11 denis...@unibe.ch wrote: > However, while you can just omit `--citeproc` when targeting docx, once > you go back you’ll end up with citations like `\[@doe\]`, i.e. brackets > will be escaped in the markdown. It’s obviously easy enough to take care of > that with search-replace, but it’s not a fully automatic solution. > > > > *Von:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org *Im > Auftrag von *denis...-NSENcxR/0n0@public.gmane.org > *Gesendet:* Freitag, 10. November 2023 22:12 > *An:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > *Betreff:* AW: Preserving citations between docx and markdown conversions > > > > Probably a good suggestion. > > > > *Von:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org *Im > Auftrag von *Paul M. > *Gesendet:* Dienstag, 7. November 2023 16:43 > *An:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > *Betreff:* Re: Preserving citations between docx and markdown conversions > > > > Sie erhalten nicht oft eine E-Mail von pmm...-Re5JQEeQqe9fmgfxC/sS/w@public.gmane.org Erfahren Sie, > warum dies wichtig ist > > Might it be simpler to leave the citekeys unprocessed during the initial > conversion to Word? > > > > I think the citekyes format is simple enough to be self explanatory, and > the markup is no more disruptive to reading then a standard author date > citation style. You can tell your collaborators that these will be replaced > by appropriately formatted citations at the final edit stage. > > > > On Tue, Nov 7, 2023 at 10:18 AM Alex wrote: > > Hello! I am investigating using pandoc for my academic writing. I intend > to do the majority of the writing in markdown but will have others > reviewing and giving feedback through word (docx), and would like a way to > re-integrate the edits back to markdown while keeping the text as close as > possible. (md -> docx -> md) > > > > In my markdown I have citations using the [@citekey] format: > > > > Here is a reference to one of the entries in my bibliography > [@Aigrain2021]. > > > > I would like a way to preserve citations when converting between docx and > md. > > I've tried the following approach but just get plain text (in the > markdown) where the citation was. > > > > Here is a reference to one of the entries in my bibliography (Aigrain > 2021). > > > > I am not sure whether the citations are being lost in the md to docx step > or the docx to md step. (I am not familiar with the how word even stores > citations) > > > > Is what I want to do supported? > > I have the files: > > main.md > > main.bib > > nature-conservation.csl > > > > The command I'm using to convert to docx (md -> docx): > > pandoc --citeproc \ > --bibliography main.bib \ > --csl nature-conservation.csl \ > -t docx+citations -o main.docx \ > -f markdown+citations main.md > > > > The command I'm using to convert back to markdown: > > pandoc -s --citeproc \ > --bibliography main.bib \ > --csl nature-conservation.csl \ > -t markdown+citations -o main.md \ > -f docx+citations main.docx > > > > Any ideas would be much appreciated. Thanks! > > -- > 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/eead1157-56fa-4259-a223-a365c852e0cbn%40googlegroups.com > > . > > -- > 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/CABoaWcXmivZz6kL_GcwVFn7Co-Qo7RfX8m1Gec_bqDyFmLJS-w%40mail.gmail.com > > . > > -- > 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit > https://groups.google.com/d/msgid/pandoc-discuss/GV0P278MB0211D7FB7C6886B4EC81C53C83AEA%40GV0P278MB0211.CHEP278.PROD.OUTLOOK.COM > > . > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/3e2ee894-5bd3-444c-9f44-bbce58ae22adn%40googlegroups.com.