Hello,

Fabrice Popineau <fabrice.popin...@supelec.fr> 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

Reply via email to