From 4752312e1d705ab6dea382e46f22804f5d7df021 Mon Sep 17 00:00:00 2001 From: Diogo Ferrari Date: Tue, 6 Sep 2022 16:17:30 -0700 Subject: [PATCH] Add more options on prettify format --- org-ref-prettify.el | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/org-ref-prettify.el b/org-ref-prettify.el index 9833b9d..9a3e6a5 100644 --- a/org-ref-prettify.el +++ b/org-ref-prettify.el @@ -145,24 +145,25 @@ PRE and POST are what taken from the citation before and after &key." (str (cond ((equal type "textcite") - (concat author " (" year - (and page (if year (concat ", " page) page)) - ")")) + (concat author " (" year (and page (if year (concat ", " page) page)) ")")) + ((equal type "citet") + (concat author " (" year (and page (if year (concat ", " page) page)) ")")) + ((equal type "citep") title + ;; (concat "(" author ", " year (and page (if year (concat ", " page) page)) ")")) + (concat "" author ", " year (and page (if year (concat ", " page) page)) "")) ((equal type "citeauthor") author) ((equal type "citeyear") year) ((equal type "citetitle") title) + ((equal type "bibentry") title + (concat author " (" year ") " title ".")) + ((equal type "fullcite") title + (concat author " (" year ") " title ".")) (t (concat author (and year (concat ", " year)) (and page (concat ", " page))))))) - (concat pre - (if (or page (null post)) - str - (concat str - ;; Add leading space to POST if it does not have it. - (if (string-match-p "\\` " post) - post - (concat " " post))))))) + (concat pre (if page str (concat str post))))) + (defun org-ref-prettify-get-entry-fields (entry) "Return (AUTHOR YEAR TITLE) list for the citation ENTRY."