emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] src-blocks with captions do not respect attr_latex :placement option


From: John Kitchin
Subject: [O] src-blocks with captions do not respect attr_latex :placement options
Date: Wed, 14 Feb 2018 11:44:21 -0800

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.

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)))

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]".

Thoughts?

John

-----------------------------------
Professor John Kitchin 
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803

reply via email to

[Prev in Thread] Current Thread [Next in Thread]