"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)
+
+(defcustom org-ref-open-notes-function
+ (lambda ()
+ (org-show-entry)
+ (show-branches)
+ (show-children)
+ (org-cycle '(64))
+ ;;(org-tree-to-indirect-buffer)
+ (outline-previous-visible-heading 1)
+ (recenter-top-bottom 0))
+ "User-defined way to open a notes entry. This is excecuted after the entry is found, with the cursor at the beginning of the headline. The default setting fully expands the notes, and moves the headline to the top of the buffer")
#+END_SRC
This next variable determines the citation types that are available in org-ref. Links for each one are automatically generated, and completion functions are automatically generated. Users may add to this list in their own init files.
"footcites" "footcitetexts"
"smartcites" "Smartcites" "textcites" "Textcites"
"supercites" "autocites" "Autocites"
+ ;; for the bibentry package
+ "bibentry"
)
"List of citation types known in org-ref"
:type '(repeat :tag "List of citation types" string)
((eq format 'ascii) (org-ref-get-ascii-bibliography))
((eq format 'html) (org-ref-get-html-bibliography))
((eq format 'latex)
- ;; write out the latex bibliography command
- (format "\\bibliography{%s}" (replace-regexp-in-string "\\.bib" "" (expand-file-name keyword)))))))
+ ;; write out the latex bibliography command
+ (format "\\bibliography{%s}" (replace-regexp-in-string "\\.bib" "" (mapconcat 'identity
+ (mapcar 'expand-file-name
+ (split-string keyword ","))
+ ",")))))))
+
#+END_SRC
#+BEGIN_SRC emacs-lisp :tangle org-ref.el
;; we did not find anything, so go back to where we came
(org-mark-ring-goto)
(error "%s not found" label))
+ (org-show-entry)
(message "go back with (org-mark-ring-goto) `C-c &`"))
;formatting
(lambda (keyword desc format)
;; now look for entry in the notes file
(if org-ref-bibliography-notes
- (find-file org-ref-bibliography-notes)
+ (find-file-other-window org-ref-bibliography-notes)
(error "org-ref-bib-bibliography-notes is not set to anything"))
(goto-char (point-min))
;; put new entry in notes if we don't find it.
(if (re-search-forward (format ":Custom_ID: %s$" key) nil 'end)
- (progn
- (org-show-entry)
- (show-children)
- (outline-previous-visible-heading 1)
- (recenter-top-bottom 0))
+ (funcall org-ref-open-notes-function)
;; no entry found, so add one
(insert (format "\n** TODO %s - %s" year title))
(insert (format"
(save-buffer))))
#+END_SRC
+#+BEGIN_SRC emacs-lisp :tangle org-ref.el
+(defun org-ref-open-notes-from-reftex ()
+ "Call reftex, and open notes for selected entry."
+ (interactive)
+ (let ((bibtex-key )))
+
+ ;; now look for entry in the notes file
+ (if org-ref-bibliography-notes
+ (find-file-other-window org-ref-bibliography-notes)
+ (error "org-ref-bib-bibliography-notes is not set to anything"))
+
+ (goto-char (point-min))
+
+ (re-search-forward (format
+ ":Custom_ID: %s$"
+ (first (reftex-citation t)) nil 'end))
+ (funcall org-ref-open-notes-function))
+#+END_SRC
+
** open url in browser from bibtex
We bind this to a key here [[*key%20bindings%20for%20utilities][key bindings for utilities]].
(defalias 'orp 'org-ref-open-pdf-at-point)
(defalias 'oru 'org-ref-open-url-at-point)
(defalias 'orn 'org-ref-open-notes-at-point)
+(defalias 'ornr 'org-ref-open-notes-from-reftex)
(defalias 'orib 'org-ref-insert-bibliography-link)
(defalias 'oric 'org-ref-insert-cite-link)