emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [RFC] [PATCH] ox-latex: support :float no with caption for minte


From: Nicolas Goaziou
Subject: Re: [O] [RFC] [PATCH] ox-latex: support :float no with caption for minted listings
Date: Fri, 19 Sep 2014 22:13:27 +0200

Hello,

Aaron Ecay <address@hidden> 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



reply via email to

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