As different bibtex types share common keys, it is advantageous to separate data extraction from json, and the formatting of the bibtex entry.
-#+BEGIN_SRC emacs-lisp :notangle doi-utils.el
+#+BEGIN_SRC emacs-lisp :tangle doi-utils.el
(defmacro defpar (name &optional value)
`(progn (defvar ,name)
(setf ,name ,value)))
#+END_SRC
With the code generating the bibtex entry in place, we can glue it to the json retrieval code.
-#+BEGIN_SRC emacs-lisp :notangle doi-utils.el
+#+BEGIN_SRC emacs-lisp :tangle doi-utils.el
(defun doi-utils-doi-to-bibtex-string (doi)
"return a bibtex entry as a string for the doi. Only articles are currently supported"
(let* ((results (doi-utils-get-json-metadata doi))