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