From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: org-ref file path to pdf Date: Thu, 08 Dec 2016 21:08:43 -0500 Message-ID: References: <868trt5j4u.fsf@georgotto.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cFAdX-0006IP-OF for emacs-orgmode@gnu.org; Thu, 08 Dec 2016 21:10:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cFAdU-00044B-Iw for emacs-orgmode@gnu.org; Thu, 08 Dec 2016 21:10:11 -0500 Received: from mail-qk0-f175.google.com ([209.85.220.175]:32994) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cFAdU-0003oZ-Dr for emacs-orgmode@gnu.org; Thu, 08 Dec 2016 21:10:08 -0500 Received: by mail-qk0-f175.google.com with SMTP id x190so4595935qkb.0 for ; Thu, 08 Dec 2016 18:09:47 -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" To: "Georg W. Otto" Cc: emacs-orgmode@gnu.org I just pushed a feature that might get you back what you want. You can now put [[file:%F][%f]] in the org-ref-note-title-format variable, and it will put (concat org-ref-pdf-directory key ".pdf") in for %F, and (concat key ".pdf") in for %f. There is unfortunately, no check if the pdf actually exists though. A second option is to write a function to add to a new hook variable: org-ref-create-notes-hook There is an example function in that that adds a cite link (which can open a pdf), but if you wanted to you could write a function that would add a file link to a pdf if it could find one. I hope those help. Georg W. Otto writes: > John Kitchin writes: > >> This doesn't sound like something that should be happening I think. How >> current is your org-ref? >> >> I do not use the notes feature so it does not get tested too often. You >> may be able to control the format of the notes created with the variable >> org-ref-note-title-format if you are using the default notes function >> that adds a headline. >> >> > > my org ref version was 20160503 from elpa. I updated it to 20161129 and > here the part of org-ref-open-bibtex-notes that inserts a link to the > pdf is commented out. However I like this functionality, so I keep the > older version of org-ref-open-bibtex-notes in my init file. > > Sorry about asking about a functionality that has been removed, but I > still do not understand why it it does expand my ~/dir to > /home/user/dir. > > My org-ref-open-bibtex-notes is set to adaptive. > > It might happen here, but I do not understand elisp enough to tell: > > (setq pdf (-first 'f-file? > (--map (f-join it (concat key ".pdf")) > (-flatten (list org-ref-pdf-directory))))) > > (if (file-exists-p pdf) > (insert (format > " [[file:%s][pdf]]\n\n" > pdf))) > > > Cheers, > > Georg -- 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