Function: org-latex-src-block--custom
org-latex-src-block--custom is a byte-compiled function defined in
ox-latex.el.gz.
Signature
(org-latex-src-block--custom &key SRC-BLOCK INFO CAPTION CAPTION-ABOVE-P ATTRIBUTES FLOAT CUSTOM-ENV &allow-other-keys)
Documentation
Transcode a SRC-BLOCK element from Org to LaTeX, using a custom environment.
LANG, CAPTION, CAPTION-ABOVE-P, LABEL, NUM-START, RETAIN-LABELS, ATTRIBUTES
and FLOAT are extracted from SRC-BLOCK and INFO in org-latex-src-block.
Source Code
;; Defined in /usr/src/emacs/lisp/org/ox-latex.el.gz
(cl-defun org-latex-src-block--custom
(&key src-block info caption caption-above-p attributes float custom-env &allow-other-keys)
"Transcode a SRC-BLOCK element from Org to LaTeX, using a custom environment.
LANG, CAPTION, CAPTION-ABOVE-P, LABEL, NUM-START, RETAIN-LABELS, ATTRIBUTES
and FLOAT are extracted from SRC-BLOCK and INFO in `org-latex-src-block'."
(let ((caption-str (org-latex--caption/label-string src-block info))
(formatted-src (org-export-format-code-default src-block info)))
(if (string-match-p "\\`[a-zA-Z0-9]+\\'" custom-env)
(format "\\begin{%s}\n%s\\end{%s}\n"
custom-env
(concat (and caption-above-p caption-str)
formatted-src
(and (not caption-above-p) caption-str))
custom-env)
(format-spec custom-env
`((?s . ,formatted-src)
(?c . ,caption)
(?f . ,float)
(?l . ,(org-latex--label src-block info))
(?o . ,(or (plist-get attributes :options) "")))))))