From 3a4705f454ed5f692ce9d04f81d3ae9bc2efad56 Mon Sep 17 00:00:00 2001 From: "Pedro A. Aranda Gutierrez" Date: Mon, 12 Dec 2022 13:51:49 +0100 Subject: [PATCH 2/2] Allow to suppress language= in SRC blocks --- lisp/ox-latex.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index f03903605..924afb399 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1021,6 +1021,15 @@ in this list - but it does not hurt if it is present." (symbol :tag "Major mode ") (string :tag "Listings language")))) +(defcustom org-latex-listings-src-omit-language nil + "Set this option to t to omit the +\"language=\" +in the parameters to \\begin{lstlisting} when exporting a src block" + :group 'org-export-latex + :version "30.0" + :package-version '(Org . "9.7") + :type 'boolean) + (defcustom org-latex-listings-options nil "Association list of options for the latex listings package. @@ -3593,7 +3602,8 @@ and FLOAT are extracted from SRC-BLOCK and INFO in `org-latex-src-block'." ((string= "multicolumn" float) '(("float" "*"))) ((and float (not (assoc "float" lst-opt))) `(("float" ,(plist-get info :latex-default-figure-position))))) - `(("language" ,lst-lang)) + (unless org-latex-listings-src-omit-language + `(("language" ,lst-lang))) (when label `(("label" ,(org-latex--label src-block info)))) (when caption-str -- 2.25.1