emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Anders Johansson <mejlaandersj@gmail.com>
To: Matt Price <moptop99@gmail.com>
Cc: org-mode-email <emacs-orgmode@gnu.org>,
	Bruce D'Arcus <bdarcus@gmail.com>
Subject: Re: [wip-cite-new] Exporting to pandoc md (and from there to zotero odt)
Date: Thu, 10 Mar 2022 20:50:11 +0100	[thread overview]
Message-ID: <CAKJdtO9-ea4cRSbRjfZesXWgqPmV0DJ_Mo-j0K-BCeWNLzqoPA@mail.gmail.com> (raw)
In-Reply-To: <CAKJdtO_vd9p2Kj+P-AYOdBXOW3BWfjzp936WFkbn+12wHy6hUw@mail.gmail.com>

Hi,
>We should also get pandoc to support updated org-cite syntax.
> https://github.com/jgm/pandoc/issues/7329

Now that pandoc has org-cite support, I found it simpler to reuse
ox-pandoc (https://github.com/emacsorphanage/ox-pandoc) and just do
this very simple configuration. ox-pandoc exports to an intermediary
org file, so we can just make sure to reinsert citations in org
format.

(use-package ox-pandoc
  :custom (org-pandoc-options-for-odt
           '((lua-filter . "/home/aj/lib/bbt-pandoc-zotero.lua")
             (metadata . "zotero_author_in_text=true"))))

(org-cite-register-processor 'pandoc
  :export-citation #'oc-pandoc-export-citation
  :export-bibliography #'oc-pandoc-export-bibliography)

(defun oc-pandoc-export-citation (citation _style _ _info)
  "Export CITATION object in org format."
  (org-element-citation-interpreter
   citation
   (mapconcat (lambda (r) (org-element-citation-reference-interpreter r nil))
              (org-cite-get-references citation))))

(defun oc-pandoc-export-bibliography (_k _f _s _p _b _i)
  "Generate a #+print_bibliography:"
  "#+print_bibliography:")


      reply	other threads:[~2022-03-10 19:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-23 19:56 [wip-cite-new] Exporting to pandoc md (and from there to zotero odt) Anders Johansson
2021-06-23 20:02 ` Bruce D'Arcus
2021-06-29 18:29   ` Matt Price
2021-07-02 15:49     ` Matt Price
2021-07-02 22:10       ` Anders Johansson
2022-03-10 19:50         ` Anders Johansson [this message]

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKJdtO9-ea4cRSbRjfZesXWgqPmV0DJ_Mo-j0K-BCeWNLzqoPA@mail.gmail.com \
    --to=mejlaandersj@gmail.com \
    --cc=bdarcus@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=moptop99@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).