emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] Add "latex" option to ox-bibtex.el


From: Nicolas Goaziou
Subject: Re: [O] [PATCH] Add "latex" option to ox-bibtex.el
Date: Fri, 12 Jul 2013 15:36:13 +0200

> Really?  This problem can be resolved with hooks or filters?  Could you
> give me more informations or a example?

Perhaps something like the following (untested) should do the trick:

  (defun my-bibliography-selector-hook (backend)
    (case backend
      (latex
       (when (save-excursion
               (re-search-forward "^[ \t]*\\bibliography\\(?:style\\)?{" nil t))
         (while (re-search-forward "^[ \t]*#+BIBLIOGRAPHY:.*$" nil t)
           (when (eq (org-element-type (save-match-data (org-element-at-point)))
                     'keyword)
             (replace-match "")))))
      (html
       (when (save-excursion
               (re-search-forward "^[ \t]*#+BIBLIOGRAPHY:.*$" nil t))
         (while (re-search-forward "^[ \t]*\\bibliography\\(?:style\\)?{.*$" 
nil t)
           (replace-match ""))))))

  (add-hook 'org-export-before-parsing-hook 'my-bibliography-selector-hook)


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]