+* DOI functions for WOS
+I came across this API http://wokinfo.com/media/pdf/OpenURL-guide.pdf to make links to the things I am interested in here. Based on that document, here are three links based on a doi:10.1021/jp047349j that take you to different Web Of Science (WOS) pages.
+
+
+1. go to article in WOS: http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:doi/10.1021/jp047349j
+2. citing articles: http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info%3Adoi%2F10.1021/jp047349j&svc_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Asch_svc&svc.citing=yes
+3. related articles: http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info%3Adoi%2F10.1021/jp047349j&svc_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Asch_svc&svc.related=yes
+
+These are pretty easy to construct, so we can write functions that will create them and open the url in our browser. There are some other options that could be considered, but since we usually have a doi, it seems like the best way to go for creating the links. Here are the functions.
+
+#+BEGIN_SRC emacs-lisp :tangle doi-utils.el
+(defun doi-utils-wos (doi)
+ "Open Web of Science entry for DOI"
+ (interactive "sDOI: ")
+ (browse-url
+ (format
+ "http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info:doi/%s" doi)))
+
+(defun doi-utils-wos-citing (doi)
+ "Open Web of Science citing articles entry. May be empty if none are found"
+ (interactive "sDOI: ")
+ (browse-url
+ (concat
+ "http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info%3Adoi%2F"
+ doi
+ "&svc_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Asch_svc&svc.citing=yes")))
+
+(defun doi-utils-wos-related (doi)
+ "Open Web of Science related articles page."
+ (interactive "sDOI: ")
+ (browse-url
+ (concat "http://ws.isiknowledge.com/cps/openurl/service?url_ver=Z39.88-2004&rft_id=info%3Adoi%2F"
+ doi
+ "&svc_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Asch_svc&svc.related=yes")))
+
+#+END_SRC
+
+* A new doi link for org-mode
+The idea is to add a menu to the doi link, so rather than just clicking to open the article, you can do other things.
+1. open doi
+2. open in wos
+3. open citing articles
+4. open related articles
+5. open bibtex entry
+6. get bibtex entry
+
+#+BEGIN_SRC emacs-lisp :tangle doi-utils.el :results silent
+(defun doi-utils-open (doi)
+ (interactive "sDOI: ")
+ (browse-url (concat "http://dx.doi.org/" doi)))
+
+
+(defun doi-utils-open-bibtex (doi)
+ "Search through `reftex-default-bibliography' for DOI."
+ (interactive "sDOI: ")
+ (catch 'file
+ (dolist (f reftex-default-bibliography)
+ (find-file f)
+ (when (search-forward doi (point-max) t)
+ (bibtex-beginning-of-entry)
+ (throw 'file t)))))
+
+
+(defun doi-utils-crossref (doi)
+ "Search DOI in CrossRef."
+ (interactive "sDOI: ")
+ (browse-url
+ (format
+ "http://search.crossref.org/?q=%s" doi)))
+
+
+(defun doi-utils-google-scholar (doi)
+ "Google scholar the word at point or selection."
+ (interactive "sDOI: ")
+ (browse-url
+ (format
+ "http://scholar.google.com/scholar?q=%s" doi)))
+
+
+(defun doi-utils-pubmed (doi)
+ "Pubmed the word at point or selection."
+ (interactive "sDOI: ")
+ (browse-url
+ (format
+ "http://www.ncbi.nlm.nih.gov/pubmed/?term=%s"
+ (url-hexify-string doi))))
+
+
+(defvar doi-link-menu-funcs '()
+ "Functions to run in doi menu. Each entry is a list of (key menu-name function).
+The function must take one argument, the doi.")
+
+(setq doi-link-menu-funcs
+ '(("o" "pen" doi-utils-open)
+ ("w" "os" doi-utils-wos)
+ ("c" "iting articles" doi-utils-wos-citing)
+ ("r" "elated articles" doi-utils-wos-related)
+ ("s" "Google Scholar" doi-utils-google-scholar)
+ ("f" "CrossRef" doi-utils-crossref)
+ ("p" "ubmed" doi-utils-pubmed)
+ ("b" "open in bibtex" doi-utils-open-bibtex)
+ ("g" "et bibtex entry" doi-utils-add-bibtex-entry-from-doi)))
+
+
+(defun doi-link-menu (link-string)
+ "Generate the link menu message, get choice and execute it.
+Options are stored in `doi-link-menu-funcs'."
+ (interactive)
+ (message
+ (concat
+ (mapconcat
+ (lambda (tup)
+ (concat "[" (elt tup 0) "]"
+ (elt tup 1) " "))
+ doi-link-menu-funcs "") ": "))
+ (let* ((input (read-char-exclusive))
+ (choice (assoc
+ (char-to-string input) doi-link-menu-funcs)))
+ (when choice
+ (funcall
+ (elt
+ choice
+ 2)
+ link-string))))
+
+(org-add-link-type
+ "doi"
+ 'doi-link-menu)
+#+END_SRC
+
+doi:10.1021/jp047349j
+