|
From: | feng shu |
Subject: | Re: [O] [PATCH] Add "latex" option to ox-bibtex.el |
Date: | Sat, 13 Jul 2013 07:15:34 +0800 |
> 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
[Prev in Thread] | Current Thread | [Next in Thread] |