From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kai Chen Subject: Re: org-ref is not using default bibliography file Date: Sun, 13 Dec 2015 13:10:57 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11407fecea40340526c094d3 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7yw0-0007r1-5m for emacs-orgmode@gnu.org; Sun, 13 Dec 2015 00:11:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a7yvy-0000a1-9f for emacs-orgmode@gnu.org; Sun, 13 Dec 2015 00:11:00 -0500 Received: from mail-io0-x22e.google.com ([2607:f8b0:4001:c06::22e]:36265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a7yvy-0000Zx-2g for emacs-orgmode@gnu.org; Sun, 13 Dec 2015 00:10:58 -0500 Received: by iofo67 with SMTP id o67so14725194iof.3 for ; Sat, 12 Dec 2015 21:10:57 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Kitchin Cc: "emacs-orgmode@gnu.org" --001a11407fecea40340526c094d3 Content-Type: text/plain; charset=UTF-8 Thanks for pointing out!!! This did the trick for me (using backquote `): (setq reftex-default-bibliography `(,(concat my-dropbox-path "bibliography/references.bib"))) Thanks again for your prompt help! Cheers, Kai On Sun, Dec 13, 2015 at 11:59 AM, John Kitchin wrote: > That probably means some variable should be a list and it isn't, it is > just a string. > > > On Saturday, December 12, 2015, Kai Chen wrote: > >> Well I was wrong, after I expand my-dropbox-path to full path, the >> problem is still there. >> >> Here are the results, the upper one is with the bibliography link while >> the one at the bottom is without. Only the format changes, one with a >> quoted | but another with a leading : >> Could this be the cause? >> >> === From notes.org === >> ..... some text with citations >> bibliography:/home/kai/Dropbox/bibliography/references.bib >> >> #+BEGIN_SRC emacs-lisp >> (org-ref-find-bibliography) >> #+END_SRC >> >> #+RESULTS: >> | /home/kai/Dropbox/bibliography/references.bib | >> >> : /home/kai/Dropbox/bibliography/references.bib >> >> >> >> On Sun, Dec 13, 2015 at 11:11 AM, Kai Chen >> wrote: >> >>> Thanks for your suggestion! The problem lies in a variable I set which >>> points to the directory of my Dropbox folder, to ensure emacs portable on >>> different OS. >>> >>> When I have the bibliography link in the org file, the >>> (org-ref-find-bibliography) will return the absolute path to the .bib file, >>> which in my case is >>> /home/kai/Dropbox/bibliography/references.bib >>> But if I do not have the link, it returns >>> ~/Dropbox/bibliography/references.bib >>> >>> It seems some modules are resolving the '~' while some others are not. >>> >>> Cheers, >>> Kai >>> >>> >>> On Sun, Dec 13, 2015 at 2:15 AM, John Kitchin >>> wrote: >>> >>>> That sounds odd. >>>> >>>> What is the output of this src block in your file? >>>> >>>> #+BEGIN_SRC emacs-lisp >>>> (org-ref-find-bibliography) >>>> #+END_SRC >>>> >>>> >>>> >>>> Kai Chen writes: >>>> >>>> > Dear list, >>>> > >>>> > I just got to know org-ref, and I followed the github help page to >>>> manually >>>> > install the package and set the default path similar to the >>>> configuration >>>> > provided in the follow link: >>>> > https://github.com/jkitchin/org-ref >>>> > >>>> > And I installed all the dependency packages like helm-bibtex, hydra >>>> etc. >>>> > >>>> > But when I am citing (using "C-c ]") an existing entry which is in the >>>> > default references.bib file, I can see the entry after I stroke the >>>> > command, but after I selected it and pressed enter, when the cursor >>>> is on >>>> > the link, the mini-buffer says: >>>> > !!! No entry found !!! >>>> > But previously the org-ref-helm-insert-cite-link properly showed that >>>> > entry. This can only work when I manually add a bibliography link at >>>> the >>>> > bottom of the file, which means org-ref is not using the default >>>> > bibliography file. >>>> > >>>> > So what should I check to fix this issue? >>>> > >>>> > Thanks for your help! >>>> > >>>> > The following is my configuration of org-ref: >>>> > >>>> > #+BEGIN_SRC emacs-lisp >>>> > (setq org-ref-path (concat my-dropbox-path "software/org-ref/")) >>>> > >>>> > (setq reftex-default-bibliography (concat my-dropbox-path >>>> > "bibliography/references.bib")) >>>> > >>>> > ;; see org-ref for use of these variables >>>> > (setq org-ref-bibliography-notes (concat my-dropbox-path >>>> "bibliography/ >>>> > notes.org") >>>> > org-ref-default-bibliography (concat my-dropbox-path >>>> > "bibliography/references.bib") >>>> > org-ref-pdf-directory (concat my-dropbox-path >>>> > "bibliography/bibtex-pdfs/")) >>>> > >>>> > ;; *** helm-bibtex >>>> > >>>> > (setq helm-bibtex-bibliography (concat my-dropbox-path >>>> > "bibliography/references.bib")) >>>> > (setq helm-bibtex-library-path (concat my-dropbox-path >>>> > "bibliography/bibtex-pdfs")) >>>> > >>>> > ;; open pdf with system pdf viewer (works on mac) >>>> > (when (eq system-type 'darwin) >>>> > (setq helm-bibtex-pdf-open-function >>>> > (lambda (fpath) >>>> > (start-process "open" "*open*" "open" fpath)))) >>>> > >>>> > ;; alternative >>>> > ;; (setq helm-bibtex-pdf-open-function 'org-open-file) >>>> > >>>> > (setq helm-bibtex-notes-path (concat my-dropbox-path >>>> > "bibliography/helm-bibtex-notes")) >>>> > >>>> > (global-set-key [f10] 'org-ref-open-bibtex-notes) >>>> > (global-set-key [f11] 'org-ref-open-bibtex-pdf) >>>> > (global-set-key [f12] 'org-ref-open-in-browser) >>>> > >>>> > (add-to-list 'load-path org-ref-path) >>>> > >>>> > ;; make sure you have dash, helm, helm-bibtex, ebib, s, f, hydra and >>>> > key-chord >>>> > ;; in your load-path >>>> > ;; auto-install dependencies >>>> > (require 'org-ref) >>>> > >>>> > ;; optional but very useful libraries in org-ref >>>> > (require 'doi-utils) >>>> > (require 'jmax-bibtex) >>>> > (require 'pubmed) >>>> > (require 'arxiv) >>>> > (require 'sci-id) >>>> > >>>> > #+END_SRC >>>> >>>> -- >>>> Professor John Kitchin >>>> Doherty Hall A207F >>>> Department of Chemical Engineering >>>> Carnegie Mellon University >>>> Pittsburgh, PA 15213 >>>> 412-268-7803 >>>> @johnkitchin >>>> http://kitchingroup.cheme.cmu.edu >>>> >>>> >>> >>> >>> -- >>> Regards >>> >>> Multi-Agent System Lab >>> University of Science and Technology of China >>> >>> K.Chen >>> >> >> >> >> -- >> Regards >> >> Multi-Agent System Lab >> University of Science and Technology of China >> >> K.Chen >> > > > -- > John > > ----------------------------------- > Professor John Kitchin > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > > > -- Regards Multi-Agent System Lab University of Science and Technology of China K.Chen --001a11407fecea40340526c094d3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for pointing out!!!

This did the trick for me (using backquote `):

(setq reftex-defaul= t-bibliography `(,(concat my-dropbox-path "bibliography/references.bib= ")))

Thanks again for your prompt help!

Chee= rs,
Kai

On Sun, Dec 13, 2015 at 11:59 AM, John Kitchin &= lt;jkitchin@an= drew.cmu.edu> wrote:
That p= robably means some variable should be a list and it isn't, it is just a= string.=C2=A0


On Saturday, Dece= mber 12, 2015, Kai Chen <chk0105@mail.ustc.edu.cn> wrote:
Well I was wrong, after I expand m= y-dropbox-path to full path, the problem is still there.

Here = are the results, the upper one is with the bibliography link while the one = at the bottom is without. Only the format changes, one with a quoted | but = another with a leading :
Could this be the cause?

=3D=3D=3D From notes.org =3D=3D=3D
..... some text with citations
bibliography:/home/kai/Dropbox/bibliography/references.bib
=
#+BEGIN_SRC emacs-lisp
(org-ref-find-bibliography)
#+END_SRC
<= br>#+RESULTS:
| /home/kai/Dropbox/bibliography/references.bib |

:= /home/kai/Dropbox/bibliography/references.bib



On Sun, Dec 13, 2015 a= t 11:11 AM, Kai Chen <chk0105@mail.ustc.edu.cn&= gt; wrote:
<= div>
Thanks for your suggestion! The problem lies in a variab= le I set which points to the directory of my Dropbox folder, to ensure emac= s portable on different OS.

When I have the bibliography link = in the org file, the (org-ref-find-bibliography) will return the absolute p= ath to the .bib file, which in my case is
/home/kai/Dropbox/bibliograph= y/references.bib
But if I do not have the link, it returns
~/Dr= opbox/bibliography/references.bib

It seems some modules are re= solving the '~' while some others are not.

Cheers,
=
Kai


On Sun, Dec 13, 2015 at 2:15 AM, John Kitchin <= ;jkitchin@andrew.cmu.edu> wrote:
That sounds odd.

What is the output of this src block in your file?

#+BEGIN_SRC emacs-lisp
(org-ref-find-bibliography)
#+END_SRC



Kai Chen writes:

> Dear list,
>
> I just got to know org-ref, and I followed the github help page to man= ually
> install the package and set the default path similar to the configurat= ion
> provided in the follow link:
> https://github.com/jkitchin/org-ref
>
> And I installed all the dependency packages like helm-bibtex, hydra et= c.
>
> But when I am citing (using "C-c ]") an existing entry which= is in the
> default references.bib file, I can see the entry after I stroke the > command, but after I selected it and pressed enter, when the cursor is= on
> the link, the mini-buffer says:
> !!! No entry found !!!
> But previously the org-ref-helm-insert-cite-link properly showed that<= br> > entry. This can only work when I manually add a bibliography link at t= he
> bottom of the file, which means org-ref is not using the default
> bibliography file.
>
> So what should I check to fix this issue?
>
> Thanks for your help!
>
> The following is my configuration of org-ref:
>
> #+BEGIN_SRC emacs-lisp
>=C2=A0 =C2=A0(setq org-ref-path (concat my-dropbox-path "software/= org-ref/"))
>
>=C2=A0 =C2=A0(setq reftex-default-bibliography (concat my-dropbox-path<= br> > "bibliography/references.bib"))
>
>=C2=A0 =C2=A0;; see org-ref for use of these variables
>=C2=A0 =C2=A0(setq org-ref-bibliography-notes (concat my-dropbox-path &= quot;bibliography/
> note= s.org")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0org-ref-default-bibliography (concat = my-dropbox-path
> "bibliography/references.bib")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0org-ref-pdf-directory (concat my-drop= box-path
> "bibliography/bibtex-pdfs/"))
>
>=C2=A0 =C2=A0;; *** helm-bibtex
>
>=C2=A0 =C2=A0(setq helm-bibtex-bibliography (concat my-dropbox-path
> "bibliography/references.bib"))
>=C2=A0 =C2=A0(setq helm-bibtex-library-path (concat my-dropbox-path
> "bibliography/bibtex-pdfs"))
>
>=C2=A0 =C2=A0;; open pdf with system pdf viewer (works on mac)
>=C2=A0 =C2=A0(when (eq system-type 'darwin)
>=C2=A0 =C2=A0 =C2=A0(setq helm-bibtex-pdf-open-function
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda (fpath)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(start-process "open" "= ;*open*" "open" fpath))))
>
>=C2=A0 =C2=A0;; alternative
>=C2=A0 =C2=A0;; (setq helm-bibtex-pdf-open-function 'org-open-file)=
>
>=C2=A0 =C2=A0(setq helm-bibtex-notes-path (concat my-dropbox-path
> "bibliography/helm-bibtex-notes"))
>
>=C2=A0 =C2=A0(global-set-key [f10] 'org-ref-open-bibtex-notes)
>=C2=A0 =C2=A0(global-set-key [f11] 'org-ref-open-bibtex-pdf)
>=C2=A0 =C2=A0(global-set-key [f12] 'org-ref-open-in-browser)
>
>=C2=A0 =C2=A0(add-to-list 'load-path org-ref-path)
>
>=C2=A0 =C2=A0;; make sure you have dash, helm, helm-bibtex, ebib, s, f,= hydra and
> key-chord
>=C2=A0 =C2=A0;; in your load-path
>=C2=A0 =C2=A0;; auto-install dependencies
>=C2=A0 =C2=A0(require 'org-ref)
>
>=C2=A0 =C2=A0;; optional but very useful libraries in org-ref
>=C2=A0 =C2=A0(require 'doi-utils)
>=C2=A0 =C2=A0(require 'jmax-bibtex)
>=C2=A0 =C2=A0(require 'pubmed)
>=C2=A0 =C2=A0(require 'arxiv)
>=C2=A0 =C2=A0(require 'sci-id)
>
> #+END_SRC

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-= 268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu




--
=
Regards

Multi-Agent System Lab
U= niversity of Science and Technology of China

K.Chen



--
<= div>
Regards

Multi-Agent System Lab
University of Scien= ce and Technology of China

K.Chen


--
John

-----------------------------------
Pro= fessor John Kitchin=C2=A0
Doherty Hall A207F
Department of Chemical E= ngineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-780= 3




--
Regards

Multi-Agent System = Lab
University of Science and Technology of China

K.Chen
--001a11407fecea40340526c094d3--