From 5b0601d6d3b8034202c4b9b820c64a719e3129b9 Mon Sep 17 00:00:00 2001 From: Matt Huszagh Date: Wed, 29 Dec 2021 19:35:42 -0800 Subject: [PATCH] ox-latex.el: Fix caption format for custom latex src block 2021-12-29 Matt Huszagh * lisp/ox-latex.el (org-latex-src-block): Use `org-export-get-caption' to extract caption from element. Otherwise, the full caption contains a large number of unnecessary parentheses. --- lisp/ox-latex.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 8187119ec..a9c6a4b5c 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -3021,7 +3021,8 @@ contextual information." custom-env) (format-spec custom-env `((?s . ,formatted-src) - (?c . ,caption) + (?c . ,(org-export-data (org-export-get-caption src-block) + info)) (?f . ,float) (?l . ,(org-latex--label src-block info)) (?o . ,(or (plist-get attributes :options) ""))))))) -- 2.31.1