From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC] [PATCH] ox-latex: support :float no with caption for minted listings Date: Fri, 19 Sep 2014 22:13:27 +0200 Message-ID: <877g0zv060.fsf_-_@nicolasgoaziou.fr> References: <1408779394-11436-1-git-send-email-aaronecay@gmail.com> <87ha13dm3v.fsf@nicolasgoaziou.fr> <87oavbostg.fsf@gmail.com> <87a96uep52.fsf@nicolasgoaziou.fr> <87d2bqpvgr.fsf@gmail.com> <87tx514qaa.fsf@nicolasgoaziou.fr> <87r401tdc7.fsf@gmail.com> <87oav5eztu.fsf@nicolasgoaziou.fr> <87mw9vqvo1.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XV4Y8-0006GO-AP for emacs-orgmode@gnu.org; Fri, 19 Sep 2014 16:13:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XV4Xy-0001fw-6H for emacs-orgmode@gnu.org; Fri, 19 Sep 2014 16:13:00 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:55637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XV4Xy-0001ff-08 for emacs-orgmode@gnu.org; Fri, 19 Sep 2014 16:12:50 -0400 Received: from mfilter21-d.gandi.net (mfilter21-d.gandi.net [217.70.178.149]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id 84DEE172071 for ; Fri, 19 Sep 2014 22:12:43 +0200 (CEST) Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mfilter21-d.gandi.net (mfilter21-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id Hp76N6zjuipR for ; Fri, 19 Sep 2014 22:12:42 +0200 (CEST) Received: from selenimh (unknown [91.224.148.150]) (Authenticated sender: mail@nicolasgoaziou.fr) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id CE21D172085 for ; Fri, 19 Sep 2014 22:12:41 +0200 (CEST) In-Reply-To: <87mw9vqvo1.fsf@gmail.com> (Aaron Ecay's message of "Fri, 19 Sep 2014 15:04:14 -0400") 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: emacs-orgmode@gnu.org Hello, Aaron Ecay writes: > See the attached patch. Thanks for the patch. > I updated ORG-NEWS, but the manual (info "(org) LaTeX specific > attributes") is already sufficiently general IMO. OK. > +- capt-of: for captions on `:float nil' source blocks I think this is too limiting as we might use this package in other places. "for captions outside of floats" may be more appropriate. > +You can have listings with a caption which nonetheless do not > +float. This is useful in case the source code takes up more than > +a page, in which case trying to float it will also truncate it. > +To achieve this, you should specifying the following attributes > +on the source block: > + > + #+caption: ... > + #+attr_latex: :float no > + #+begin_src > + ... > + #+end_src I wonder if this is even needed. ":float nil" is described in the manual, and "capt-of" is loaded by default. IOW there's no real need to warn the user about a natural feature which doesn't require any intervention. > + (cond ((and (not float) (plist-member attributes :float) caption) > + (format "%%s\n%s" (replace-regexp-in-string > + "\\\\caption" "\\captionof{listing}" > + caption-str t t))) > + ((and (not float) (plist-member attributes :float)) "%s") This can do for now. Ultimately, however, I think we could merge `org-latex--wrap-label' into `org-latex--caption/label-string' (which should then produce "\captionof" command when appropriate). By then, the `replace-regexp-in-string' would not be needed anymore. WDYT? In any case, I think you can apply the patch once the docstrings questions above have been sorted out. Regards, -- Nicolas Goaziou