From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] Add "latex" option to ox-bibtex.el Date: Fri, 12 Jul 2013 15:36:13 +0200 Message-ID: <87ip0f99yq.fsf@gmail.com> References: <87vc4g83po.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxdW4-0006zG-Dj for emacs-orgmode@gnu.org; Fri, 12 Jul 2013 09:36:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxdVx-0004RY-5R for emacs-orgmode@gnu.org; Fri, 12 Jul 2013 09:36:08 -0400 Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]:37315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxdVw-0004RQ-VR for emacs-orgmode@gnu.org; Fri, 12 Jul 2013 09:36:01 -0400 Received: by mail-we0-f169.google.com with SMTP id n57so8182199wev.0 for ; Fri, 12 Jul 2013 06:36:00 -0700 (PDT) In-Reply-To: (feng shu's message of "Fri, 12 Jul 2013 21:17:18 +0800") 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: feng shu Cc: "emacs-orgmode@gnu.org" > 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