emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nik Putnam <nik@mcmxi.com>
To: emacs-orgmode@gnu.org
Subject: org-exp-bibtex.el patch for zotero-generated citekeys
Date: Mon, 12 Sep 2011 15:26:06 -0500	[thread overview]
Message-ID: <CALMLZJMtU1UNJRTXZ-pEFpyVt1sBsJxiONCQ6+gzcD+wK9S-xA@mail.gmail.com> (raw)

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 "<hr>" nil t)
               (replace-match "<hr/>" t t))

             reply	other threads:[~2011-09-12 20:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-12 20:26 Nik Putnam [this message]
2011-10-06  8:11 ` org-exp-bibtex.el patch for zotero-generated citekeys Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALMLZJMtU1UNJRTXZ-pEFpyVt1sBsJxiONCQ6+gzcD+wK9S-xA@mail.gmail.com \
    --to=nik@mcmxi.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).