]> git.donarmstrong.com Git - org-ref.git/blobdiff - pubmed.org
fix bug in missing bibtex file arg
[org-ref.git] / pubmed.org
index 9b616f80afa7fff45f9149e70539eaa07b0eba8e..7febb4a4565ddde08eacd4def3377ad15c7822a2 100644 (file)
@@ -18,6 +18,7 @@ See http://www.ncbi.nlm.nih.gov/pmc/about/public-access-info/#p3 for details of
 
 For PMID there is one interactive function that inserts a bibtex entry: pubmed-insert-bibtex-from-pmid.
 
+This library is complementary to [[./doi-utils.org]].
 
 * Header
 #+BEGIN_SRC emacs-lisp :tangle pubmed.el
@@ -47,13 +48,26 @@ For PMID there is one interactive function that inserts a bibtex entry: pubmed-i
 ;;
 ;; Lisp code to interact with pubmed databases, links to pubmed
 ;; identifiers. See pubmed.org.
+;;;
+;; This library provides links that go to pubmed resources, e.g.
+;;
+;; pmcid:PMC3498956
+;;
+;; pmid:23162369
+;;
+;; and nihmsid:NIHMS395714
+;;
+;; See http://www.ncbi.nlm.nih.gov/pmc/about/public-access-info/#p3 for details of these identifiers.
+;;
+;; For PMID there is one interactive function that inserts a bibtex
+;; entry: `pubmed-insert-bibtex-from-pmid`.
 #+END_SRC
 
 * PMID (from PubMed) link and functions
 A PMID is a number that identifies an entry in the Pubmed database.  The PMID is a unique reference number for PubMed citations. The PMID is a distinctly different number from the PMCID and is used only for PubMed records.
 
 
-#+BEGIN_SRC emacs-lisp :tangle pubmed.el
+#+BEGIN_SRC emacs-lisp :tangle pubmed.el :results silent
 (org-add-link-type
  "pmid"
  ;; clicking
@@ -61,12 +75,15 @@ A PMID is a number that identifies an entry in the Pubmed database.  The PMID is
  ;; formatting
 (lambda (keyword desc format)
    (cond
-    ((eq format 'html) (format "")); no output for html
+    ((eq format 'html)
+     (format "<a href=\"http://www.ncbi.nlm.nih.gov/pmc/articles/mid/%s\">pmid:%s</a>" keyword keyword)); no output for html
     ((eq format 'latex)
      ;; write out the latex command
      (format "\\url{http://www.ncbi.nlm.nih.gov/pmc/articles/mid/%s}" keyword)))))
 #+END_SRC
 
+
+
 ** Get MEDLINE metadata
 We can get bibliographic metadata from a pmid. Here we get the MEDLINE text. The website wraps the data in <pre></pre> tags.
 
@@ -227,10 +244,6 @@ We can parse this into a data structure
 ** PMID to bibtex entry
 The point of parsing the MEDLINE text is so we can make bibtex entries. We only support Journal articles for now.
 
-Issues:
-1. The year is not quite right, it has the month in it.
-2. I do not use all the fields.
-
 #+BEGIN_SRC emacs-lisp
 (defun pubmed-pmid-to-bibtex (pmid)
   "Convert a PMID to a bibtex entry."
@@ -525,7 +538,7 @@ A PMCID starts with PMC and is followed by numbers. The PMCID is a unique refere
 
 Here we define a new link. Clicking on it simply opens a webpage to the article.
 
-#+BEGIN_SRC emacs-lisp :tangle pubmed.el
+#+BEGIN_SRC emacs-lisp :tangle pubmed.el :results silent
 (org-add-link-type
  "pmcid"
  ;; clicking
@@ -534,7 +547,7 @@ Here we define a new link. Clicking on it simply opens a webpage to the article.
 (lambda (keyword desc format)
    (cond
     ((eq format 'html)
-     (format "<a href=\"http://www.ncbi.nlm.nih.gov/pmc/articles/%s\">" keyword))
+     (format "<a href=\"http://www.ncbi.nlm.nih.gov/pmc/articles/%s\">pmcid:%s</a>" keyword keyword))
     ((eq format 'latex)
      (format "\\url{http://www.ncbi.nlm.nih.gov/pmc/articles/%s}" keyword)))))
 #+END_SRC
@@ -542,7 +555,7 @@ Here we define a new link. Clicking on it simply opens a webpage to the article.
 * NIHMSID 
 The NIHMSID is a preliminary article identifier that applies only to manuscripts deposited through the NIHMS system. The NIHMSID is only valid for compliance reporting for 90 days after the publication date of an article. Once the Web version of the NIHMS submission is approved for inclusion in PMC and the corresponding citation is in PubMed, the article will also be assigned a PMCID.
 
-#+BEGIN_SRC emacs-lisp :tangle pubmed.el
+#+BEGIN_SRC emacs-lisp :tangle pubmed.el :results silent
 (org-add-link-type
  "nihmsid"
  ;; clicking
@@ -550,15 +563,14 @@ The NIHMSID is a preliminary article identifier that applies only to manuscripts
  ;; formatting
 (lambda (keyword desc format)
    (cond
-    ((eq format 'html) (format "")); no output for html
+    ((eq format 'html)
+     (format "<a href=\"http://www.ncbi.nlm.nih.gov/pmc/articles/mid//%s\">nihmsid:%s</a>" keyword keyword))
     ((eq format 'latex)
      ;; write out the latex command
-     (format "\\url{http://www.ncbi.nlm.nih.gov/pmc/articles/mid//%s}" keyword)))))
+     (format "\\url{http://www.ncbi.nlm.nih.gov/pmc/articles/mid/%s}" keyword)))))
 #+END_SRC
 
-#+RESULTS:
-| lambda | (link-string)         | (browse-url (format http://www.ncbi.nlm.nih.gov/pmc/articles/mid/%s link-string))                                                               |
-| lambda | (keyword desc format) | (cond ((eq format (quote html)) (format )) ((eq format (quote latex)) (format \url{http://www.ncbi.nlm.nih.gov/pmc/articles/mid//%s} keyword))) |
+
 
 
 * End of code