I want to add a option which can setting bib for html export and latex
export separately,
As it for the reason:
1. bibtex2html can't work well with complex bib style, so using a simple
style and making it
show correctly is reasonable choose,
2. bibtex2html can't find bib style in current dir, for example
(./file.sty) ,
3. the biblatex user.
In my opinion, the solution seemd more hacky than mine for a user, It let
my org-mode file more unportable.
Could you share you opinion and reason about my approach: Is the idea ,
separating with a new option, hacky? or my code hacky? .
On Fri, Jul 12, 2013 at 9:36 PM, Nicolas Goaziou <[email protected]>wrote:
> > 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
>