(defcustom org-ref-bibliography-entry-format
'(("article" . "%a, %t, <i>%j</i>, <b>%v(%n)</b>, %p (%y). <a href=\"%U\">link</a>. <a href=\"http://dx.doi.org/%D\">doi</a>.")
- ("book" . "%a, %t, %u (%y)."))
+
+ ("book" . "%a, %t, %u (%y).")
+
+ ("proceedings" . "%e, %t in %S, %u (%y).")
+
+ ("inproceedings" . "%a, %t, %p, in %b, edited by %e, %u (%y)"))
+
"string to format an entry. Just the reference, no numbering at the beginning, etc... see the `org-ref-reftex-format-citation' docstring for the escape codes."
:type 'string
:group 'org-ref)
format)
(defun org-ref-get-bibtex-entry-citation (key)
- "returns a string for the bibliography entry corresponding to key, and formatted according to `org-ref-bibliography-entry-format'"
+ "returns a string for the bibliography entry corresponding to key, and formatted according to the type in `org-ref-bibliography-entry-format'"
(let ((org-ref-bibliography-files (org-ref-find-bibliography))
- (file) (entry) (bibtex-entry) (entry-type))
+ (file) (entry) (bibtex-entry) (entry-type) (format))
(setq file (catch 'result
(loop for file in org-ref-bibliography-files do
(insert-file-contents file)
(bibtex-search-entry key nil 0)
(setq bibtex-entry (bibtex-parse-entry))
- (setq entry-type (cdr (assoc "=type=" bibtex-entry)))
- (setq entry (org-ref-reftex-format-citation bibtex-entry (cdr (assoc entry-type org-ref-bibliography-entry-format)))))
+ (setq entry-type (downcase (cdr (assoc "=type=" bibtex-entry))))
+ (setq format (cdr (assoc entry-type org-ref-bibliography-entry-format)))
+ (if format
+ (setq entry (org-ref-reftex-format-citation bibtex-entry format))
+ (save-restriction
+ (bibtex-narrow-to-entry)
+ (setq entry (buffer-string)))))
entry))
#+END_SRC