Add a function to export formatted citation using Pandoc
This commit is contained in:
parent
87a8e677ec
commit
d76370a796
1 changed files with 13 additions and 0 deletions
13
init.el
13
init.el
|
@ -554,6 +554,19 @@
|
|||
|
||||
(setq bibtex-autokey-year-length 4))
|
||||
|
||||
(defun formatted-citation-at-point ()
|
||||
"Kill the formatted citation for the reference at point using Pandoc."
|
||||
(interactive)
|
||||
(let* ((bibfile (expand-file-name (car (org-ref-find-bibliography))))
|
||||
(cslfile (concat (file-name-directory bibfile) "chicago-author-date.csl")))
|
||||
(kill-new
|
||||
(shell-command-to-string
|
||||
(format
|
||||
"echo cite:%s | pandoc --filter=pandoc-citeproc --bibliography=%s --csl=%s -f org -t markdown_strict | tail -n +3"
|
||||
(org-ref-get-bibtex-key-under-cursor)
|
||||
bibfile
|
||||
cslfile)))))
|
||||
|
||||
(use-package org-roam
|
||||
:ensure t
|
||||
:hook (after-init . org-roam-mode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue