Marvin Gülker <[email protected]> writes:

> That is, if this is my org document:
>
>     This is a sentence with
>     citations. [cite:@doe1997foo;cf. @someoneelse2000 p. 3]
>
> I would like to have an Elisp list containing only "doe1997foo" and
> "someoneelse2000".

Hi, Marvin,

Here's one approach. It uses the function org-cite-list-keys, which is
called during export, so I've put it into an export hook. On each
export, the variable my/org-exported-citekeys is updated with the list
of citekeys. Not tested extensively.

#+begin_src elisp
  (defvar my/org-exported-citekeys nil
    "List of citekeys in the last exported document.")

  (defun my/org-get-citekeys (string backend info)
    (setq my/org-exported-citekeys (org-cite-list-keys info))
    string)     

  (add-hook 'org-export-filter-body-functions
            'my/org-get-citekeys)
#+end_src

Regards,
Christian

Reply via email to