From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: src-blocks with captions do not respect attr_latex :placement options Date: Mon, 26 Feb 2018 11:23:04 +0100 Message-ID: <87fu5oyrqv.fsf@nicolasgoaziou.fr> References: <874lmdl1re.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqFw4-0006sY-H9 for emacs-orgmode@gnu.org; Mon, 26 Feb 2018 05:23:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqFw3-00087A-Kz for emacs-orgmode@gnu.org; Mon, 26 Feb 2018 05:23:08 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:45446) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eqFw3-00086U-EQ for emacs-orgmode@gnu.org; Mon, 26 Feb 2018 05:23:07 -0500 In-Reply-To: (John Kitchin's message of "Sun, 25 Feb 2018 16:37:35 -0800") 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: John Kitchin Cc: org-mode-email Hello, John Kitchin writes: > org-latex-default-figure-position is defined as "htbp" > > where as :placement is usually defined as "[H]". One has brackets, and > one doesn't. This is reflected in ox-latex too. > > For example in this code (line 3219. ox-latex.el) > > (or (plist-get attr :placement) > (format "[%s]" (plist-get info > :latex-default-figure-position))) > > it is implied that :latex-default-figure-position does not have > brackets, but that (plist-get attr :placement) does since it is later > used in line 3259 as: > > (format "\\begin{%s}%s\n" float-env placement) > > So, it seems like one either has to add [] to the default > org-latex-default-figure-position, or put them in the template, or > change how the :placement value is used. It doesn't seem like we can > have it both ways without testing if there are brackets or not. It also > doesn't seem right to modify org-latex-default-figure-position just to > get float listings to be "[H]" for src blocks. OK. Note that Org provides `org-unbracket-string'. Regards, -- Nicolas Goaziou