From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Berger Subject: Navigatable and exportable bib/notes links - Was: Re: Integration of RefTeX and LaTeX export Date: Fri, 23 Mar 2012 17:14:30 +0100 Message-ID: <8762dvpa55.fsf_-_@asustour.olivierberger.com> References: <24B979D4-6B28-4521-92F5-AED136335FB0@canterbury.ac.nz> <29415.1329456681@alphaville> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:59415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SB7gp-00012g-Uh for emacs-orgmode@gnu.org; Fri, 23 Mar 2012 12:50:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SB7gj-0005ld-H3 for emacs-orgmode@gnu.org; Fri, 23 Mar 2012 12:50:11 -0400 Received: from plane.gmane.org ([80.91.229.3]:54767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SB7gj-0005jt-9m for emacs-orgmode@gnu.org; Fri, 23 Mar 2012 12:50:05 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SB7gh-0005xw-O4 for emacs-orgmode@gnu.org; Fri, 23 Mar 2012 17:50:03 +0100 Received: from mag77-1-82-238-14-130.fbx.proxad.net ([82.238.14.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Mar 2012 17:50:03 +0100 Received: from oberger by mag77-1-82-238-14-130.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Mar 2012 17:50:03 +0100 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: emacs-orgmode@gnu.org Hi. FWIW, I've been inspired by your code and some other posts on the topic of bibliographic references / notes management with org-mode and have summarized the results in [0]. The end result : links like [[note:abibref]] or [[bib:abibref]] which respectively point to a bibliography notes or a bibtex section in a .bib, and which both can be exported to latex as regular \cite{abibref} references would do. Hope this helps. Best regards, [0] http://www-public.it-sudparis.eu/~berger_o/weblog/2012/03/23/how-to-manage-and-export-bibliographic-notesrefs-in-org-mode/ Nick Dokos writes: > I'm pretty sure the second function is not quoted properly in your > org-add-link-type so it ends up actually getting called at the time of > the org-add-link-type is called. > > Try the following: > > > > --8<---------------cut here---------------start------------->8--- > (defun rt-follow-handler (path) > (message "dummy handler called, path = %s" path) > (let ((arg (concat "\\cite{" path "}"))) > (reftex-view-crossref arg))) > > (defun rt-export-handler (path desc format) > (message "my handler is called") > (cond ((eq format 'latex) > (if (or (not desc) (equal 0 (search "rtcite:" desc))) > (format "\\cite{%s}" path) > (format "\\cite[%s]{%s}" desc path))))) > > (require 'org) > (org-add-link-type "rtcite" > (function rt-follow-handler) > (function rt-export-handler)) > --8<---------------cut here---------------end--------------->8--- > > > > By way of explanation: > > I had this as part of a minimal .emacs and it seems to work more or > less OK: I replaced the error call with a message call, because it > actually triggered and blew up :-) The rt-export-handler needs tweaking > but you 'll know what to do better than I do when you see the latex > output. > > I had to (require 'org) to pick up the definition of org-add-link-type: > that seems to be a missing autoload somewhere. > > And finally I like to quote functions with function, not quote, for > compiled-code reasons, but in most cases, it won't make any difference: > use quotes if you prefer. > > Nick > -- Olivier BERGER (OpenPGP: 4096R/7C5BB6A5) http://www.olivierberger.com/weblog/