Переглянути джерело

ox-latex.el: Downcase language name in minted blocks

* lisp/ox-latex.el (org-latex-export-to-latex): Downcase the language
name when using minted highlighting for src block exports.

Minted, by convention, uses all lowercase names for languages.  This
will handle mappings like "R" to "r" or "Python" to "python"
automatically.  More complex renamings still need to be handled by
customizing `org-latex-minted-langs'.

Note that the `downcase' is only applied when using the "automatic"
name.  Names in `org-latex-minted-langs' still need to be lower-case.

TINYCHANGE
Michael Weylandt 11 роки тому
батько
коміт
0820d002cb
1 змінених файлів з 3 додано та 2 видалено
  1. 3 2
      lisp/ox-latex.el

+ 3 - 2
lisp/ox-latex.el

@@ -1476,7 +1476,7 @@ contextual information."
       (let* ((org-lang (org-element-property :language inline-src-block))
 	     (mint-lang (or (cadr (assq (intern org-lang)
 					org-latex-minted-langs))
-			    org-lang))
+			    (downcase org-lang)))
 	     (options (org-latex--make-option-string
 		       org-latex-minted-options)))
 	(concat (format "\\mint%s{%s}"
@@ -2116,7 +2116,8 @@ contextual information."
 		       ("firstnumber" ,(number-to-string (1+ num-start))))
 		     org-latex-minted-options)))
 		 ;; Language.
-		 (or (cadr (assq (intern lang) org-latex-minted-langs)) lang)
+		 (or (cadr (assq (intern lang) org-latex-minted-langs))
+		     (downcase lang))
 		 ;; Source code.
 		 (let* ((code-info (org-export-unravel-code src-block))
 			(max-width