]> git.donarmstrong.com Git - org-ref.git/blobdiff - org-ref.org
update so you can have better html bibliography export
[org-ref.git] / org-ref.org
index add6b5750564ee835004fa012f41997e96d4d774..d2982c2cf224337e2713be87cd34e9d7b972d476 100644 (file)
@@ -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, <i>%j</i>, <b>%v(%n)</b>, %p (%y). <a href=\"%U\">link</a>. <a href=\"http://dx.doi.org/%D\">doi</a>.")
 
 (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)
   "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)
   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))
 
   (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
 
     (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))
       (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
 
     entry))
 #+END_SRC