Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions org-ref-prettify.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down