From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Exporting org-bibtex links as \cite{} refs in Latex Date: Tue, 27 Mar 2012 22:41:24 +0200 Message-ID: <877gy54w0b.fsf@gnu.org> References: <87pqc3cjut.fsf@inf-8657.int-evry.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCg60-0004x3-0g for emacs-orgmode@gnu.org; Tue, 27 Mar 2012 19:46:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCg5x-0007mb-UH for emacs-orgmode@gnu.org; Tue, 27 Mar 2012 19:46:35 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:59713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCg5x-0007j2-M3 for emacs-orgmode@gnu.org; Tue, 27 Mar 2012 19:46:33 -0400 Received: by mail-wg0-f49.google.com with SMTP id dr1so332718wgb.30 for ; Tue, 27 Mar 2012 16:46:32 -0700 (PDT) In-Reply-To: <87pqc3cjut.fsf@inf-8657.int-evry.fr> (Olivier Berger's message of "Fri, 23 Mar 2012 18:23:06 +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: Olivier Berger Cc: emacs-orgmode@gnu.org Hi Olivier, Olivier Berger writes: > 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 ? This is *very* reasonable and I would welcome a patch for such an export function. Thanks! -- Bastien