Skip to content

Instantly share code, notes, and snippets.

@bdarcus
Last active July 23, 2021 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdarcus/5dd05ce983377a98bc086173f9c5b860 to your computer and use it in GitHub Desktop.
Save bdarcus/5dd05ce983377a98bc086173f9c5b860 to your computer and use it in GitHub Desktop.
flatten org-cite-supported-styles
;; https://github.com/jkitchin/org-ref/issues/885#issuecomment-885682807
;; doesn't currently handle the nil style correctly
(defun oc-bibtex-actions--simple-styles (&optional targets)
(let ((styles (org-cite-supported-styles targets)))
(cl-loop for group in styles append
(let ((main (pop group)))
(when (string= "nil" (car main)) (setf (car main) ""))
(append (list (car main))
(cl-loop for rest in group collect
;; needs to remove "/nil"
(format "%s/%s"
(car main)
(car (cdr rest)))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment