[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] src-blocks with captions do not respect attr_latex :placement op
From: |
Nicolas Goaziou |
Subject: |
Re: [O] src-blocks with captions do not respect attr_latex :placement options |
Date: |
Mon, 26 Feb 2018 11:23:04 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Hello,
John Kitchin <address@hidden> 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