emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-exp-bibtex.el patch for zotero-generated citekeys
@ 2011-09-12 20:26 Nik Putnam
  2011-10-06  8:11 ` Carsten Dominik
  0 siblings, 1 reply; 2+ messages in thread
From: Nik Putnam @ 2011-09-12 20:26 UTC (permalink / raw)
  To: emacs-orgmode

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))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: org-exp-bibtex.el patch for zotero-generated citekeys
  2011-09-12 20:26 org-exp-bibtex.el patch for zotero-generated citekeys Nik Putnam
@ 2011-10-06  8:11 ` Carsten Dominik
  0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2011-10-06  8:11 UTC (permalink / raw)
  To: Nik Putnam; +Cc: emacs-orgmode

This patch has now been accepted.

- Carsten

On Sep 12, 2011, at 10:26 PM, Nik Putnam wrote:

> 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))
> 

- Carsten

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-06  8:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-12 20:26 org-exp-bibtex.el patch for zotero-generated citekeys Nik Putnam
2011-10-06  8:11 ` Carsten Dominik

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).