Skip to content

Instantly share code, notes, and snippets.

@ruediger
Last active December 17, 2015 17:58
Show Gist options
  • Save ruediger/5649308 to your computer and use it in GitHub Desktop.
Save ruediger/5649308 to your computer and use it in GitHub Desktop.
urlify doi entries in bibtex
;; A better version of this is now upstream! See comments.
;; bibtex-mode
(add-hook 'bibtex-mode-hook
(lambda ()
(setq bibtex-generate-url-list
(cons (list '("doi" . "10\\.[0-9]+/.+")
(concat (or org-doi-server-url "http://dx.doi.org/") "%s")
'("doi" "10\\.[0-9]+/.+" 0))
bibtex-generate-url-list)
bibtex-font-lock-url-regexp
(concat "^[ \t]*"
(regexp-opt (delete-dups (mapcar 'caar bibtex-generate-url-list)) t)
"[ \t]*=[ \t]*"))))
@ruediger
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment