ox-latex: Extend :placement attribute to source blocks

* lisp/ox-latex.el (org-latex-src-block): Extend :placement attribute
to source blocks when the minted package is used.

TINYCHANGE
This commit is contained in:
Mario Schlegel 2019-09-12 14:50:01 +02:00 committed by Nicolas Goaziou
parent d07d8ff416
commit 23113feb9a
1 changed files with 5 additions and 3 deletions

View File

@ -2957,21 +2957,23 @@ contextual information."
;; Case 3. Use minted package.
((eq listings 'minted)
(let* ((caption-str (org-latex--caption/label-string src-block info))
(placement (or (org-unbracket-string "[" "]" (plist-get attributes :placement))
(plist-get info :latex-default-figure-position)))
(float-env
(cond
((string= "multicolumn" float)
(format "\\begin{listing*}[%s]\n%s%%s\n%s\\end{listing*}"
(plist-get info :latex-default-figure-position)
placement
(if caption-above-p caption-str "")
(if caption-above-p "" caption-str)))
(caption
(format "\\begin{listing}[%s]\n%s%%s\n%s\\end{listing}"
(plist-get info :latex-default-figure-position)
placement
(if caption-above-p caption-str "")
(if caption-above-p "" caption-str)))
((string= "t" float)
(concat (format "\\begin{listing}[%s]\n"
(plist-get info :latex-default-figure-position))
placement)
"%s\n\\end{listing}"))
(t "%s")))
(options (plist-get info :latex-minted-options))