1 ;;; org-ref-init.el --- setup bibliography, cite, ref and label org-mode links.
3 ;; Copyright(C) 2014 John Kitchin
5 ;; Author: John Kitchin <jkitchin@andrew.cmu.edu>
6 ;; This file is not currently part of GNU Emacs.
8 ;; This program is free software; you can redistribute it and/or
9 ;; modify it under the terms of the GNU General Public License as
10 ;; published by the Free Software Foundation; either version 2, or (at
11 ;; your option) any later version.
13 ;; This program is distributed in the hope that it will be useful, but
14 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 ;; General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program ; see the file COPYING. If not, write to
20 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 ;; Boston, MA 02111-1307, USA.
27 ;; Lisp code to setup bibliography cite, ref and label org-mode links.
28 ;; also sets up reftex and helm for org-mode citations. The links are
29 ;; clickable and do things that are useful. You should really read
30 ;; org-ref.org for details.
32 ;; Package-Requires: ((dash) (helm) (helm-bibtex))
34 ;; org path for loadable org-files
35 (defvar org-ref-org-load-path
37 "List of directories to find org-files that `org-babel-load-file' can load code from.")
39 ;; https://github.com/jkitchin/org-ref
40 (defun org-ref-org-require (feature)
41 "Load a FEATURE from an org-file.
42 FEATURE is a symbol, and it is loaded from an org-file by the name of FEATURE.org, that is in the `org-load-path'. The FEATURE is loaded from `org-babel-load-file'."
43 (let ((org-file (concat (symbol-name feature) ".org"))
48 (loop for dir in org-ref-org-load-path do
54 (throw 'result path))))
55 (let ((default-directory (file-name-directory path)))
56 (org-babel-load-file path))))
58 ;; remember this directory
59 (defconst org-ref-dir (file-name-directory (or load-file-name
61 "Directory where org-ref is installed.")
63 ;; for loading org-files
64 (add-to-list 'org-ref-org-load-path org-ref-dir)
65 ;; for loading emacs-lisp files
66 (add-to-list 'load-path org-ref-dir)
68 (org-ref-org-require 'org-ref)
69 (org-ref-org-require 'doi-utils)
70 (org-ref-org-require 'pubmed)
71 (require 'jmax-bibtex)
73 (provide 'org-ref-init)
75 ;;; org-ref-init.el ends here