From eaaa5c2e48c054a3d6dbfea4ed0bee16c0b78369 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Thu, 17 Apr 2014 17:09:11 +0200 Subject: [PATCH] ox-latex.el (org-latex-src-block): Fix wrong propagation of labels and captions * ox-latex.el (org-latex-src-block): Fix wrong propagation of labels and captions when using the listings environment. Thanks to Dominik Ernst for reporting this: http://article.gmane.org/gmane.emacs.orgmode/84932 --- lisp/ox-latex.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 5b30246f2..53cc54f00 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2165,8 +2165,8 @@ contextual information." ((and float (not (assoc "float" org-latex-listings-options))) `(("float" ,org-latex-default-figure-position)))) `(("language" ,lst-lang)) - (when label `(("label" ,label))) - (when caption-str `(("caption" ,caption-str))) + (if label `(("label" ,label)) '(("label" " "))) + (if caption-str `(("caption" ,caption-str)) '(("caption" " "))) (cond ((assoc "numbers" org-latex-listings-options) nil) ((not num-start) '(("numbers" "none"))) ((zerop num-start) '(("numbers" "left"))) -- 2.11.4.GIT