From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33297 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alex Newsgroups: gmane.text.pandoc Subject: Re: Preserving citations between docx and markdown conversions Date: Fri, 10 Nov 2023 17:41:15 -0800 (PST) Message-ID: <3e2ee894-5bd3-444c-9f44-bbce58ae22adn@googlegroups.com> References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_31104_1732490602.1699666875353" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4908"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCGZTIEMX4GRBPNXXOVAMGQEQNQ5LKQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Nov 11 02:41:34 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f56.google.com ([209.85.160.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1r1d03-0000nH-BL for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 11 Nov 2023 02:41:32 +0100 Original-Received: by mail-oa1-f56.google.com with SMTP id 586e51a60fabf-1efa8a172d5sf2396173fac.2 for ; Fri, 10 Nov 2023 17:41:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1699666880; x=1700271680; darn=m.gmane-mx.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=V2yRAjghqiU7nT3xh9ZAymWkeiP1XprfnjWiyCuoKzc=; b=EQV7GmO6zMKJ3t69LI5PKXQ+xC+1bfFe7xeOyh+DvQIGIb/wSx1UCcZa2SvOr1aNM7 liJoy7zHPNcY0xkA5s4gFqtwI1crU8N+D8MP/qWlD7PPbJHVbTXDJuqr/dnwnwbaEdMp gSxzzFqcQ7q2EBRyvb+AYOEV3oQUR4SVGbK95vd51HH5QzRix98c5Ptz3tBksAJ0+IUu bZJaYoZWoOU8yJFUtmYxHtvJwGyUy06z11Loz42I8iYrGNByb+2J85pcsvd4YDEFfDXU KwvN6T/LVrH3ovB2j2LCFGlRn1TKkfKcyJ9jRQn+YzIvFJwkHfw8Pc7D7snzB+hhwgr+ 3uQQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699666880; x=1700271680; darn=m.gmane-mx.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=V2yRAjghqiU7nT3xh9ZAymWkeiP1XprfnjWiyCuoKzc=; b=Gv50KY9mX8HmghJlWa7PRWcVvnoa/CHwnW5V3vrj5f0sZJwVwmkKs1TzVknXw2RuRW 0sODq1oBp2qu8IN6Hrwi3x/k+aXWEbCfuHFiJGztynAwyATkqIcOJ366Vp0L9ygicK/i oayeVP49CICV8XseyslkrfM3JUWoWK9Ji+ft0dkmlr0wAnrPIzAFNX9ic6GBZzx3eCMY 6CeRQCysAFNOLvN68QkbDuwmQbn7yuV/CQ5zkIEET0dgDOJwESElbyWElYoCyjjmnWW8 QUvtnyZnnGteCl7yCPT9z+g66VV/N0Xe97yFfPNNFHvT2BTLgSasHJmCHOz1sD9dSJNZ bIAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699666880; x=1700271680; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=V2yRAjghqiU7nT3xh9ZAymWkeiP1XprfnjWiyCuoKzc=; b=ojhTGVovCYdfpz+V5HOty9qauGWYTmYjZCeorAWKIlQJoo6jJARVHZ5TACh5oleySY 1OHWlIHEu6c7twMGZI2o4BPCYI140R+3SFZW8lgZt5zq5UGhuvUA3x/cUG1KihK7IsZ5 mzO6qIXaYazcofVbhOWPZ1ZGEur/xx/6d8OI0HW1wP7koai1En6VQBckMcjnY2C2sJFq DIq1bkZydi0S2/6NKohgJzfmIEWCClU/vqBaX+g2ff8cWln1nn2z1CXJzW9vglrV8h28 pJcZIotfQf7ZIzID/G5UZ9ZqrxUIuTD69Eom0NODtWsyAAfgCD Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOJu0YyBiwHB+/nWG+e0ZN6ll4f9seChFBseZaaeKSCi+YPKriQDfA1T yjyiZZ+Oi+WzSVOu/HpOV1Y= X-Google-Smtp-Source: AGHT+IG6XDDlB5onyDG2GKfuMXd1O/4ht7kK/FPErMulF/wuu/VfDGnmtalq/uZIA6Z3jK3/PiIDBA== X-Received: by 2002:a05:6870:ac8f:b0:1ef:81dd:34b3 with SMTP id ns15-20020a056870ac8f00b001ef81dd34b3mr1059932oab.59.1699666880719; Fri, 10 Nov 2023 17:41:20 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6a00:1d8d:b0:690:ca36:e263 with SMTP id z13-20020a056a001d8d00b00690ca36e263ls1731865pfw.2.-pod-prod-07-us; Fri, 10 Nov 2023 17:41:16 -0800 (PST) X-Received: by 2002:a63:b07:0:b0:5b9:6677:b8d with SMTP id 7-20020a630b07000000b005b966770b8dmr219717pgl.6.1699666876059; Fri, 10 Nov 2023 17:41:16 -0800 (PST) In-Reply-To: X-Original-Sender: ac.ringeri-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:33297 Archived-At: ------=_Part_31104_1732490602.1699666875353 Content-Type: multipart/alternative; boundary="----=_Part_31105_1849024147.1699666875353" ------=_Part_31105_1849024147.1699666875353 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the additional suggestions. I ended up writing a rough filter=20 that works for my simple example:=20 https://github.com/aringeri/pandoc-citation-linking/blob/main/app/Main.hs - The export from markdown to docx requires the better bibtex filter:=20 https://github.com/retorquere/zotero-better-bibtex/blob/master/pandoc/pa= ndoc-zotero-live-citemarkers.lua - Once the docx file is created, open it up in word and hit the 'refresh= =20 zotero' button, then my filter above should be able to recover the origi= nal=20 citation keys. =20 I'm not too sure this is the idiomatic way of doing it in pandoc. I'm sure= =20 I will develop on this as I figure out my workflow. It's good to know that= =20 pandoc is very customizable. On Saturday, November 11, 2023 at 8:15:55=E2=80=AFAM UTC+11 denis...@unibe.= ch wrote: > However, while you can just omit `--citeproc` when targeting docx, once= =20 > you go back you=E2=80=99ll end up with citations like `\[@doe\]`, i.e. br= ackets=20 > will be escaped in the markdown. It=E2=80=99s obviously easy enough to ta= ke care of=20 > that with search-replace, but it=E2=80=99s not a fully automatic solution= . > > =20 > > *Von:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org *Im=20 > 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 > > =20 > > Probably a good suggestion. > > =20 > > *Von:* pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org *Im=20 > 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 > > =20 > > Sie erhalten nicht oft eine E-Mail von pmm...-Re5JQEeQqe9fmgfxC/sS/w@public.gmane.org Erfahren Sie,=20 > warum dies wichtig ist > > Might it be simpler to leave the citekeys unprocessed during the initial= =20 > conversion to Word?=20 > > =20 > > I think the citekyes format is simple enough to be self explanatory, and= =20 > the markup is no more disruptive to reading then a standard author date= =20 > citation style. You can tell your collaborators that these will be replac= ed=20 > by appropriately formatted citations at the final edit stage. =20 > > =20 > > On Tue, Nov 7, 2023 at 10:18=E2=80=AFAM Alex wrote: > > Hello! I am investigating using pandoc for my academic writing. I intend= =20 > to do the majority of the writing in markdown but will have others=20 > reviewing and giving feedback through word (docx), and would like a way t= o=20 > re-integrate the edits back to markdown while keeping the text as close a= s=20 > possible. (md -> docx -> md) > > =20 > > In my markdown I have citations using the [@citekey] format: > > =20 > > Here is a reference to one of the entries in my bibliography=20 > [@Aigrain2021]. > > =20 > > I would like a way to preserve citations when converting between docx and= =20 > md. > > I've tried the following approach but just get plain text (in the=20 > markdown) where the citation was. > > =20 > > Here is a reference to one of the entries in my bibliography (Aigrain > 2021). > > =20 > > I am not sure whether the citations are being lost in the md to docx step= =20 > or the docx to md step. (I am not familiar with the how word even stores= =20 > citations) > > =20 > > Is what I want to do supported? > > I have the files: > > main.md > > main.bib > > nature-conservation.csl > > =20 > > 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 > > =20 > > 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 > > =20 > > Any ideas would be much appreciated. Thanks! > > --=20 > You received this message because you are subscribed to the Google Groups= =20 > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an= =20 > email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/eead1157-56fa-4259-a223-= a365c852e0cbn%40googlegroups.com=20 > > . > > --=20 > You received this message because you are subscribed to the Google Groups= =20 > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an= =20 > email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/CABoaWcXmivZz6kL_GcwVFn7= Co-Qo7RfX8m1Gec_bqDyFmLJS-w%40mail.gmail.com=20 > > . > > --=20 > You received this message because you are subscribed to the Google Groups= =20 > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an= =20 > email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/GV0P278MB0211D7FB7C6886B= 4EC81C53C83AEA%40GV0P278MB0211.CHEP278.PROD.OUTLOOK.COM=20 > > . > --=20 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 e= mail 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. ------=_Part_31105_1849024147.1699666875353 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for the additional suggestions. I ended up writing a rough filter th= at works for my simple example: https://github.com/aringeri/pandoc-citation= -linking/blob/main/app/Main.hs
  • The export from markdown t= o docx requires the better bibtex filter: https://github.com/retorquere/zot= ero-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 origina= l citation keys.
I'm not too sure this is the idiomati= c way of doing it in pandoc. I'm sure I will develop on this as I figure ou= t my workflow. It's good to know that pandoc is very customizable.
On Saturday,= November 11, 2023 at 8:15:55=E2=80=AFAM UTC+11 denis...-NSENcxR/0n0@public.gmane.org wrote:

However, while you can just omi= t `--citeproc` when targeting docx, once you go back you=E2=80=99ll end up = with citations like `\[@doe\]`, i.e. brackets will be escaped in the markdo= wn. It=E2=80=99s obviously easy enough to take care of that with search-replace, but it=E2= =80=99s not a fully automatic solution.

=C2=A0

Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-...@googlegroups.c= om> Im Auftrag von denis...@u= nibe.ch
Gesendet: Freitag, 10. November 2023 22:12
An: pandoc-...@googlegrou= ps.com
Betreff: AW: Preserving citations between docx and markdown conversi= ons

=C2=A0

Probably a good suggestion.

=C2=A0

Von: pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von Paul M.
Gesendet: Dienstag, 7. November 2023 16:43
An: pandoc-...@googlegrou= ps.com
Betreff: Re: Preserving citations between docx and markdown conversi= ons

=C2=A0

Might it be simpler to leave the citekeys unprocesse= d during the initial conversion to Word?

=C2=A0

I think the citekyes format is simple enough to be s= elf explanatory, and the markup is no more disruptive to reading then a sta= ndard author date citation style. You can tell your collaborators that thes= e will be replaced by appropriately formatted citations at the final edit stage.=C2=A0

=C2=A0

On Tue, Nov 7, 2023 at 10:18=E2=80=AFAM Alex <ac.ri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

Hello! I am investigating using pandoc for my academ= ic 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 l= ike a way to re-integrate the edits back to markdown while keeping the text as close as possible. (md -> do= cx -> md)

=C2=A0

In my markdown I have citations using the [@citekey]= format:

=C2=A0

Here is a re= ference to one of the entries in my bibliography [@Aigrain2021].

=C2=A0

I would like a way to preserve citations when conver= ting between docx and md.

I've tried the following approach but just get p= lain text (in the markdown) where the citation was.

=C2=A0

Here is a re= ference to one of the entries in my bibliography (Aigrain
2021).

=C2=A0

I am not sure whether the citations are being lost i= n the md to docx step or the docx to md step. (I am not familiar with the h= ow word even stores citations)

=C2=A0

Is what I want to do supported?

I have the files:

= main.md

= main.bib

= nature-conservation.csl

=C2=A0

The command I'm using to convert to docx (md -&g= t; docx):

pandoc --citeproc \
--bibliography main.bib \
--csl nature-conservation.csl \
-t docx+citations -o main.docx \
-f markdown+citations=C2=A0main.md

=C2=A0

The command I'm using to convert back to markdow= n:

pandoc -s --citeproc \
--bibliography main.bib \
--csl nature-conservation.csl \
-t markdown+citations -o main.md \
-f docx+citations=C2=A0main.docx

=C2=A0

Any ideas would be much appreciated. Thanks!<= u>

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus...-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/eead1157-56fa-4259-a223-a3= 65c852e0cbn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus...-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.
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 &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus...-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.org= m.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@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.
------=_Part_31105_1849024147.1699666875353-- ------=_Part_31104_1732490602.1699666875353--