From 7f60422b2f0b39f04efd4167e36470f938dc0fed Mon Sep 17 00:00:00 2001 From: TEC Date: Tue, 11 Jul 2023 18:19:40 +0800 Subject: [PATCH] ox-latex: Use more robust engraved theme grouping * lisp/ox-latex.el (org-latex-src--engrave-code): Use of curly brackets for grouping has a few edge-cases which \begingroup-\endgroup should not suffer from. --- 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 50a1b8003..19dec28b4 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -3858,12 +3858,12 @@ to the Verbatim environment or Verb command." (concat "\\begin{Code}\n\\begin{Verbatim}" engraved-options "\n" engraved-code "\n\\end{Verbatim}\n\\end{Code}")))) (kill-buffer engraved-buffer) - (concat "{\\engravedtheme" (if (and theme explicit-theme-p) + (concat "\\begingroup\\engravedtheme" (replace-regexp-in-string "[^A-Za-z]" "" (symbol-name theme)) engraved-wrapped - "}") + "\\endgroup") engraved-wrapped)) (user-error "Cannot engrave code as `engrave-faces-latex' is unavailable.")))