From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bibliography Date: Mon, 06 May 2013 20:51:07 +0200 Message-ID: <87wqrcdjs4.fsf@gmail.com> References: <20130506145017.GF20172@kuru.dyndns-at-home.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZQVC-0004Me-69 for emacs-orgmode@gnu.org; Mon, 06 May 2013 14:51:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZQV9-0000f0-RJ for emacs-orgmode@gnu.org; Mon, 06 May 2013 14:51:10 -0400 Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:33947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZQV9-0000eI-KJ for emacs-orgmode@gnu.org; Mon, 06 May 2013 14:51:07 -0400 Received: by mail-wi0-f178.google.com with SMTP id hm14so2873049wib.17 for ; Mon, 06 May 2013 11:51:06 -0700 (PDT) In-Reply-To: (Fabrice Popineau's message of "Mon, 6 May 2013 19:21:31 +0200") 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: Fabrice Popineau Cc: "emacs-orgmode@gnu.org" Hello, Fabrice Popineau writes: > Sure, I remember this thread and it is clear that the problem is very > different when it is for LaTeX of for and HTML backend. > However, Reftex is provided with Emacs, and it is also integrated to Org > mode. Since it is back-end dependent, why don't you use: #+latex: \bibliography{...}\bibilographystyle{...} instead? > So I was trying to solve my simple problem about the bibliography keyword > this way: > > (defadvice org-latex-keyword (around org-latex-keyword-bibliography) > "Exports `bibliography' keyword with LaTeX backend." > (let ((key (org-element-property :key (ad-get-arg 0))) > (value (org-element-property :value (ad-get-arg 0)))) > (if (and (string= key "BIBLIOGRAPHY") > (string-match "\\(\\S-+\\)[ \t]+\\(\\S-+\\)\\([^\r\n]*\\)" > value)) > (let ((bibfile (match-string 1 value)) > (bibstyle (match-string 2 value))) > (format "\\bibliography{%s}\n\\bibliographystyle{%s}" bibfile > bibstyle)) > ad-do-it))) > > (ad-activate 'org-latex-keyword) > > in my personal Org mode setup. However, it does not work. The advice is > called and returns the string, > but somehow it is not inserted in the buffer. If I do the same thing in > ox-latex.el:org-latex-keyword function, > it does work. Any idea why ? You need to set `ad-return-value' somewhere, don't you? Regards, -- Nicolas Goaziou