From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nik Putnam Subject: org-exp-bibtex.el patch for zotero-generated citekeys Date: Mon, 12 Sep 2011 15:26:06 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:51537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3D4z-0000lg-72 for emacs-orgmode@gnu.org; Mon, 12 Sep 2011 16:26:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3D4y-0007Lg-5E for emacs-orgmode@gnu.org; Mon, 12 Sep 2011 16:26:09 -0400 Received: from mail-qy0-f176.google.com ([209.85.216.176]:35125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3D4x-0007Lb-WF for emacs-orgmode@gnu.org; Mon, 12 Sep 2011 16:26:08 -0400 Received: by qyk36 with SMTP id 36so520585qyk.0 for ; Mon, 12 Sep 2011 13:26:06 -0700 (PDT) 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: emacs-orgmode@gnu.org Dear Taru and orgmode community, Org-mode export to HTML is a really useful thing, and I love the bibtex integration. I had a problem exporting from org-mode to HTML, with bibtex. I was able to fix it with a change to a regular expression org-exp-bibtex.el. The diff is shown below. (My bibtex citekeys were auto-created by zotero, and use underscores. Some even have dashes.) I thought this might be useful to others as well. Thanks, Nik --- a/contrib/lisp/org-exp-bibtex.el +++ b/contrib/lisp/org-exp-bibtex.el @@ -102,8 +102,9 @@ (save-match-data (insert-file-contents (concat file ".html")) (goto-char (point-min)) - (while (re-search-forward "a name=\"\\(\\w+\\)\">\\(\\w+\\)" nil t) - (setq oebp-cite-plist (cons (cons (match-string 1) (match-string 2)) oebp-cite-plist))) + (while (re-search-forward "a name=\"\\([a-z0-9A-Z_\\-]+\\)\">\\(\\w+\\)" nil t) + (setq oebp-cite-plist (cons (cons (match-string 1) (match-string 2)) oebp-cite-plist)) + ) (goto-char (point-min)) (while (re-search-forward "
" nil t) (replace-match "
" t t))