From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: ob-lilypond and LaTeX floats/captions Date: Fri, 26 Feb 2016 22:58:57 +0100 Message-ID: <87r3fzdtge.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZQNe-0005aX-Ru for emacs-orgmode@gnu.org; Fri, 26 Feb 2016 16:56:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aZQNa-0001r8-AV for emacs-orgmode@gnu.org; Fri, 26 Feb 2016 16:56:58 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aZQNa-0001qi-3Z for emacs-orgmode@gnu.org; Fri, 26 Feb 2016 16:56:54 -0500 In-Reply-To: (James Harkins's message of "Fri, 26 Feb 2016 23:20:52 +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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: James Harkins Cc: orgmode Hello, "James Harkins" writes: > I currently have a few LilyPond source code blocks that are working quite well as inline graphics (exported to LaTeX), e.g.: > > #+BEGIN_SRC lilypond :exports results :noweb yes :file ex1.eps > ... > #+END_SRC > > When I export, it (correctly) asks if I want to evaluate the source block, and the export (correctly) includes the line: > > \includegraphics[width=.9\linewidth]{ex1.eps} > > So far, so good. > > Now, I would like to make the results a floating figure, with a caption and a #+name reference. So I added the following to the above block: > > #+name: ex1 > #+caption: One possible form of "seed" material to start the performance. > #+BEGIN_SRC lilypond :exports results :noweb yes :file ex1.eps > ... > #+END_SRC > > ... but the #+name is not converted into a label, and the #+caption is also ignored. > > My question, then, is: What is needed to get ob-lilypond to support > LaTeX floats and captions? (I have a sneaky feeling it isn't trivial, > but it's worth asking in any case.) You are applying the name and caption to the source block, which is removed (:exports results), not to the results of the source block. So, you need to generate the results first, or at least put a RESULTS keyword below, and apply the name and caption to it. Regards, -- Nicolas Goaziou