From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mario Schlegel Subject: [PATCH] ox-latex.el: Extend :placement attribute to source blocks Date: Thu, 12 Sep 2019 14:50:01 +0200 Message-ID: <20190912125001.412971-1-m.schlegel@posteo.de> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:58577) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8OhD-00054I-6z for emacs-orgmode@gnu.org; Thu, 12 Sep 2019 08:59:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8OhC-0001xU-8s for emacs-orgmode@gnu.org; Thu, 12 Sep 2019 08:59:35 -0400 Received: from mout01.posteo.de ([185.67.36.65]:56873) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i8OhB-0001wC-OG for emacs-orgmode@gnu.org; Thu, 12 Sep 2019 08:59:34 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 951AB1600DA for ; Thu, 12 Sep 2019 14:58:46 +0200 (CEST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Cc: Mario Schlegel * lisp/ox-latex.el (org-latex-src-block): Extend :placement attribute to source blocks when the minted package is used. TINYCHANGE --- lisp/ox-latex.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 1f1be240a..77aac78f4 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -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 attribut= es :placement)) + (plist-get info :latex-default-figure-position))) (float-env (cond ((string=3D "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=3D "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)) --=20 2.23.0