From b818d84987ee230c0d8186ddcf7ac4c5c836bcdf Mon Sep 17 00:00:00 2001
From: John Kitchin <jkitchin@andrew.cmu.edu>
Date: Tue, 27 Jan 2015 08:37:13 -0500
Subject: [PATCH] add with-affiliates and catch all cite types

---
 org-ref.org | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/org-ref.org b/org-ref.org
index e4f7bdf..c9518c8 100644
--- a/org-ref.org
+++ b/org-ref.org
@@ -2614,13 +2614,21 @@ Makes a new buffer with clickable links."
     (org-element-map (org-element-parse-buffer) 'link
       (lambda (link)
 	(let ((plist (nth 1 link)))
-	  (when (equal (plist-get plist ':type) "cite")
-	    (dolist (key (org-ref-split-and-strip-string (plist-get plist ':path)) )
+	  (when (-contains? org-ref-cite-types (plist-get plist :type))
+	    (dolist (key (org-ref-split-and-strip-string (plist-get plist :path)))
 	      (when (not (index key bibtex-keys))
-		(setq bad-citations (append bad-citations
-					    `(,(format "%s [[elisp:(progn (switch-to-buffer-other-frame \"%s\")(goto-char %s))][not found here]]\n"
-						       key (buffer-name)(plist-get plist ':begin)))))
-		))))))
+		(message-box "%s" link)
+		(setq
+		 bad-citations
+		 (append
+		  bad-citations
+		  `(,(format "%s [[elisp:(progn (switch-to-buffer-other-frame \"%s\")(goto-char %s))][not found here]]\n"
+			     key
+			     (buffer-name)
+			     (plist-get plist :begin)))))
+		)))))
+      ;; set with-affilates to t to get citations in a caption
+      nil nil nil t)
 
     (if bad-citations
       (progn
-- 
2.39.5