Hello, John Kitchin <jkitc...@andrew.cmu.edu> writes:
> A block like this: > > #+attr_latex: :placement [H] > > #+caption: A test block > #+BEGIN_SRC ipython > > 'hello' > #+END_SRC > > exports to latex as: > > \begin{listing}[htbp] > \begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{ipython} > 'hello' > \end{minted} > \caption{A test block} > \end{listing} > > The root of this is in org-latex-src-block where (plist-get info > :latex-default-figure-position) is being used to specify the > placement. True. LaTeX back-end doesn't handle :placement attribute in source blocks. > It seems like a sort of easy fix, but requires a couple of changes in the > function. > > I think we could replace all instances of > > (plist-get info :latex-default-figure-position) > > with > > (or (plist-get attributes :placement) > (format "[%s]" > (plist-get info :latex-default-figure-position))) Why (format "[%s]" ...)? > and also replace everything like: > > \\begin{figure*}[%s] > > with > > \\begin{figure*}%s > > I don't see a way around that unless :latex-default-figure-position is > changed from "htbp" to "[htbp]". I fail to see why this change is needed. > Thoughts? Do you want to propose a patch? The manual would need to be updated accordingly. Regards, -- Nicolas Goaziou