From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Berger Subject: Exporting org-bibtex links as \cite{} refs in Latex Date: Fri, 23 Mar 2012 18:23:06 +0100 Message-ID: <87pqc3cjut.fsf@inf-8657.int-evry.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SB8DB-0005iy-9t for emacs-orgmode@gnu.org; Fri, 23 Mar 2012 13:23:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SB8D2-00059G-BN for emacs-orgmode@gnu.org; Fri, 23 Mar 2012 13:23:36 -0400 Received: from plane.gmane.org ([80.91.229.3]:37327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SB8D2-000593-4p for emacs-orgmode@gnu.org; Fri, 23 Mar 2012 13:23:28 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SB8Cv-0000br-Lg for emacs-orgmode@gnu.org; Fri, 23 Mar 2012 18:23:21 +0100 Received: from bauxite.int-evry.fr ([157.159.110.64]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Mar 2012 18:23:21 +0100 Received: from olivier.berger by bauxite.int-evry.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Mar 2012 18:23:21 +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. Sorry in advance if this has already been covered. AFAICT there's not yet a standard latex export for org-bibtex links. I think that the following in org-bibtex.el : (org-add-link-type "bibtex" 'org-bibtex-open) sets what's needed to navigate links like [[bibtex:mybib.bib::abibtexref]] (or [[file:mybib.bib::abibtexref]] ?) to the contents of the bibtex notice, but doesn't help with how the latex export needs to be. AFAIU, it lacks a second function that could be used to export the links. So all that's needed is another function as : (org-add-link-type "bibtex" 'org-bibtex-open 'org-bibtex-export) which would render as \cite{abibtexref}. Something like : (defun org-bibtex-export (path desc format) (let* ((search (when (string-match "::#?\\(.+\\)\\'" path) (match-string 1 path))) (path (substring path 0 (match-beginning 0)))) (cond ((eq format 'latex) (if (or (not desc) (equal 0 (search "bibtex:" desc))) (format "\\cite{%s}" search) (format "\\cite[%s]{%s}" desc search)))))) I think this can work (see more details in [0]), and maybe that wouldn't be too hard to patch org-bibtex for something more generic ? Is this reasonable ? I'm not following the list regularly, so any feedback by email couldn't hurt. 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/ -- Olivier BERGER http://www-public.it-sudparis.eu/~berger_o/ - OpenPGP-Id: 2048R/5819D7E8 Ingenieur Recherche - Dept INF Institut TELECOM, SudParis (http://www.it-sudparis.eu/), Evry (France)