From dd5c516e7c1c1787bfd3b4968d6ec6cce2a6f7c3 Mon Sep 17 00:00:00 2001 From: John Kitchin Date: Wed, 13 Aug 2014 17:27:45 -0400 Subject: [PATCH] update so you can have better html bibliography export --- org-ref.org | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/org-ref.org b/org-ref.org index add6b57..d2982c2 100644 --- a/org-ref.org +++ b/org-ref.org @@ -93,7 +93,13 @@ There are some variables needed later to tell this library where you store your (defcustom org-ref-bibliography-entry-format '(("article" . "%a, %t, %j, %v(%n), %p (%y). link. doi.") - ("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) @@ -350,10 +356,10 @@ environment, only %l is available." 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 @@ -365,8 +371,13 @@ environment, only %l is available." (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 -- 2.39.2