X-Git-Url: https://git.donarmstrong.com/?p=org-ref.git;a=blobdiff_plain;f=org-ref.org;h=d2982c2cf224337e2713be87cd34e9d7b972d476;hp=add6b5750564ee835004fa012f41997e96d4d774;hb=dd5c516e7c1c1787bfd3b4968d6ec6cce2a6f7c3;hpb=f26737a3de36f89ae77a2d071ca5d00391628fa9;ds=sidebyside 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