From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabrice Popineau Subject: Re: Bibliography Date: Mon, 6 May 2013 19:21:31 +0200 Message-ID: References: <20130506145017.GF20172@kuru.dyndns-at-home.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b3a7fe6cbef0704dc0fef43 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZP6q-0005Zw-Kz for emacs-orgmode@gnu.org; Mon, 06 May 2013 13:21:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZP6n-0001L2-Mw for emacs-orgmode@gnu.org; Mon, 06 May 2013 13:21:56 -0400 Received: from mail-ea0-x22c.google.com ([2a00:1450:4013:c01::22c]:37167) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZP6n-0001Ks-Dp for emacs-orgmode@gnu.org; Mon, 06 May 2013 13:21:53 -0400 Received: by mail-ea0-f172.google.com with SMTP id r16so1890521ead.3 for ; Mon, 06 May 2013 10:21:52 -0700 (PDT) In-Reply-To: <20130506145017.GF20172@kuru.dyndns-at-home.com> 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: Suvayu Ali Cc: "emacs-orgmode@gnu.org" --047d7b3a7fe6cbef0704dc0fef43 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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. 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=3D 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 ? Fabrice 2013/5/6 Suvayu Ali > On Mon, May 06, 2013 at 04:26:16PM +0200, Fabrice Popineau wrote: > > Is it me or is it normal that the: > > > > #+Bibliography: foo plain > > > > line is not exported by the LaTeX backend? > > > > I assume that: > > \bibliography{foo} > > \bibliographystyle{plain} > > is a decent way to handle it. > > Sometime back there was talk about integrating bibliography in the Org > syntax. That would make it backend agnostic (always a goal with most > Org features). If you are interested, take a look at the following > thread. > > > > -- > Suvayu > > Open source is the future. It sets us free. > > --=20 Fabrice Popineau ----------------------------- SUPELEC D=E9partement Informatique 3, rue Joliot Curie 91192 Gif/Yvette Cedex Tel direct : +33 (0) 169851950 Standard : +33 (0) 169851212 ------------------------------ --047d7b3a7fe6cbef0704dc0fef43 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Sure, I remember this thread and it is clear that the prob= lem 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.

So I was trying to solve my simple problem = about the bibliography keyword this way:

(defadvice org-latex-keyword (around org-latex-keyword-bibliography= )
=A0 "Exports `bibliography' keyword with LaTeX backend."=
=A0 (let ((key (org-element-property :key (ad-get-arg 0)))
=
=A0 =A0 =A0 =A0 (value (org-element-property :value (ad-get-arg 0))))<= /div>
=A0 =A0 (if (and (string=3D key "BIBLIOGRAPHY")
=A0 =A0= =A0 =A0 =A0 =A0 =A0(string-match "\\(\\S-+\\)[ \t]+\\(\\S-+\\)\\([^\r= \n]*\\)" value))
=A0 =A0 =A0 =A0 (let ((bibfile (match-strin= g 1 value))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 (bibstyle (match-string 2= value)))
=A0 =A0 =A0 =A0 =A0 (format "\\bibliography{%s}\n\\bibliographyst= yle{%s}" bibfile bibstyle))
=A0 =A0 =A0 =A0 ad-do-it)))

(ad-activate 'org-latex-keyword)

in my personal Org mode setup. However, it does not work. The advice is cal= led 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 func= tion,
it does work. Any idea why ?=A0

Fabrice


2013/5/6 Suvayu Ali <fatkasuvayu+linux@gmail.co= m>
On Mon, May 06, 2013 at 04= :26:16PM +0200, Fabrice Popineau wrote:
> Is it me or is it normal that the:
>
> #+Bibliography: foo plain
>
> line is not exported by the LaTeX backend?
>
> I assume that:
> \bibliography{foo}
> \bibliographystyle{plain}
> is a decent way to handle it.

Sometime back there was talk about integrating bibliography in the Or= g
syntax. =A0That would make it backend agnostic (always a goal with most
Org features). =A0If you are interested, take a look at the following
thread.

=A0 <http://thread.gmane.org/gmane.emacs.orgmode/674= 88/focus=3D67521>

--
Suvayu

Open source is the future. It sets us free.




-- Fabrice Popineau
-----------------------------
SUPELEC
D=E9partement Informatique
3, rue Joliot Curie
91= 192 Gif/Yvette Cedex
Tel direct : +33 (0) 169851950
Standard : +33 (0) 169851212<= /div>
------------------------------

--047d7b3a7fe6cbef0704dc0fef43--