From: Alex <ac.ringeri-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Preserving citations between docx and markdown conversions
Date: Wed, 8 Nov 2023 13:32:26 -0800 (PST) [thread overview]
Message-ID: <c85d1876-2c1e-41cf-a735-15ca9a5be81en@googlegroups.com> (raw)
In-Reply-To: <GV0P278MB02117A2D92683B79046B9E8E83A9A-WJyuHYKDu6H9IsystIVlkKYLGPO4stheiGd9ebBGJoev3QGu/rdwKA@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 5463 bytes --]
Thanks for your help Denis,
I think I'm starting to get a grasp on how this is working.
If I run my document through the zotero-better-bibtex filter, then the
docx+citations reader. I get some markdown like this:
---
...
references:
-
...
citation-key: Aigrain2021
...
id: 476
---
# Introduction
Here is a reference to one of the entries in my bibliography [@476].
# References {#references .unnumbered}
It seems the zotero/better-bibtex filter is using an internal id (476)
instead of the original citation key. I presume this is required for the
integration between Zotero and Word.
I might try and dig in to the docx to markdown conversion to:
1. Switch the ids of the citations back to the original citation key
strings.
2. Consider exporting the 'references' metadata as a separate .bib file
instead of in the header.
On Wednesday, November 8, 2023 at 2:33:30 AM UTC+11 denis...@unibe.ch wrote:
> Pandoc will resolve citations when converting to docx. Your « -t
> docx+citations » seems to have no effect here.
>
>
>
> However, there exists a filter that might be useful here:
> https://retorque.re/zotero-better-bibtex/exporting/pandoc/index.html#from-markdown-to-zotero-live-citations
>
> This will enable you to convert markdown citations to Zotero fields.
> Obviously, this means you’ll need to manage your references with Zotero.
>
> Converting them back to Markdown citations should work out of the box
> since 2.18, see the changelog :
> https://pandoc.org/releases.html#pandoc-2.18-2022-04-04
>
> Docx reader:
>
> - Enable citations extension for docx reader (#7840
> <https://github.com/jgm/pandoc/issues/7840>). When enabled, Zotero,
> Mendeley, and EndNote citations embedded in a docx are parsed as native
> pandoc citations. (When disabled, the generated citation text and
> bibliography are passed through as regular text.) The bibliography
> generated by the plugin is suppressed. Instead, bibliographic data embedded
> in citation items is added to the references metadata field so that it
> can be used with --citeproc.
>
> So, here you’ll also see what the citations extension does for docx…
>
>
>
> Best,
>
> Denis
>
>
>
> *Von:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> *Im
> Auftrag von *Alex
> *Gesendet:* Dienstag, 7. November 2023 10:03
> *An:* pandoc-discuss <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
> *Betreff:* Preserving citations between docx and markdown conversions
>
>
>
> Sie erhalten nicht oft eine E-Mail von ac.ri...-Re5JQEeQqe9fmgfxC/sS/w@public.gmane.org Erfahren Sie,
> warum dies wichtig ist <https://aka.ms/LearnAboutSenderIdentification>
>
> 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
> <https://groups.google.com/d/msgid/pandoc-discuss/eead1157-56fa-4259-a223-a365c852e0cbn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
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/c85d1876-2c1e-41cf-a735-15ca9a5be81en%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 15515 bytes --]
next prev parent reply other threads:[~2023-11-08 21:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AQHaEY26LNeu48iKBUuT9RqvJYawSLBu+rWw>
2023-11-07 9:03 ` Alex
[not found] ` <eead1157-56fa-4259-a223-a365c852e0cbn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-11-07 15:33 ` AW: " denis.maier-NSENcxR/0n0
[not found] ` <GV0P278MB02117A2D92683B79046B9E8E83A9A-WJyuHYKDu6H9IsystIVlkKYLGPO4stheiGd9ebBGJoev3QGu/rdwKA@public.gmane.org>
2023-11-08 21:32 ` Alex [this message]
[not found] ` <c85d1876-2c1e-41cf-a735-15ca9a5be81en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2023-11-09 8:53 ` denis.maier-NSENcxR/0n0
2023-11-07 15:43 ` Paul M.
[not found] ` <CABoaWcXmivZz6kL_GcwVFn7Co-Qo7RfX8m1Gec_bqDyFmLJS-w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-11-10 21:12 ` AW: " denis.maier-NSENcxR/0n0
[not found] ` <GV0P278MB0211D7FB7C6886B4EC81C53C83AEA-WJyuHYKDu6H9IsystIVlkKYLGPO4stheiGd9ebBGJoev3QGu/rdwKA@public.gmane.org>
2023-11-10 21:15 ` denis.maier-NSENcxR/0n0
[not found] ` <GV0P278MB021142EDAEA08B3C2C09D8A883AEA-WJyuHYKDu6H9IsystIVlkKYLGPO4stheiGd9ebBGJoev3QGu/rdwKA@public.gmane.org>
2023-11-11 1:41 ` Alex
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c85d1876-2c1e-41cf-a735-15ca9a5be81en@googlegroups.com \
--to=ac.ringeri-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).