From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [bug][ox-latex] Captions in equations Date: Sat, 25 Jan 2014 15:35:09 +0100 Message-ID: <877g9ojfj6.fsf@gmx.us> References: <87txd16q0s.fsf@gmx.us> <87iotg1ffu.fsf@gmail.com> <87zjms83dr.fsf@gmx.us> <87r483zrm8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W74GK-0007h9-3p for emacs-orgmode@gnu.org; Sat, 25 Jan 2014 09:31:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W74GE-0007Sf-A3 for emacs-orgmode@gnu.org; Sat, 25 Jan 2014 09:31:08 -0500 Received: from mout.gmx.net ([212.227.15.15]:50421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W74GD-0007ST-W3 for emacs-orgmode@gnu.org; Sat, 25 Jan 2014 09:31:02 -0500 Received: from W530 ([94.34.130.49]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LsCAp-1V9ljX2sTX-013vs1 for ; Sat, 25 Jan 2014 15:31:01 +0100 In-Reply-To: <87r483zrm8.fsf@gmail.com> (Nicolas Goaziou's message of "Sun, 19 Jan 2014 20:41:35 +0100") 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: n.goaziou@gmail.com Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Nicolas, Nicolas Goaziou writes: >> OK. I can prepare a patch. > > Great. Thank you. > >> In LaTeX the floating would be kind of odd, I think. At the very >> least math floats shouldn't be Figure or Tables (IMO); unfortunately >> the Internets seem to suggest that you usually create additional >> floats via packages such as newfloat of "caption". HTML should also >> be considered... > > IIRC there is a "caption" package that can add captions to objects > without making them floats. We could support it, but without requiring > that package by default. Attached is a simple patch that works by silently drops the caption in a sneaky way. I didn't experience any problems when testing it, but you might have more insights as to whether this approach have latent issues. I think we had the discussion with leaving out packages earlier, when discussing things like wrap-float etc. As I recall, the consensus was to include the necessary packages. Thus, I think solution (iii) would require adding caption to the default package alist. Caption is a package that's very good, so I wouldn't mind it. But, I'm still not convinced that non-floating caption for equation is the correct behavior. =E2=80=93Rasmus --=20 =E3=83=84 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Drop-caption-in-ox-latex-math-tables.patch >From 3470c44a7ef48a92848c39741b25e7c7cf0dddf8 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Sat, 25 Jan 2014 15:27:30 +0100 Subject: [PATCH] Drop caption in ox-latex math-tables * ox-latex.el (org-latex--math-table): Drop captions silently. --- lisp/ox-latex.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 4522c6b..4f961cb 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2577,7 +2577,10 @@ used as a communication channel. This function assumes TABLE has `org' as its `:type' property and `inline-math' or `math' as its `:mode' attribute.." - (let* ((caption (org-latex--caption/label-string table info)) + (let* (;; Silently drop captions as they are not supported in + ;; math-mode. + (caption (org-latex--caption/label-string + (org-element-put-property table :caption nil) info)) (attr (org-export-read-attribute :attr_latex table)) (inlinep (equal (plist-get attr :mode) "inline-math")) (env (or (plist-get attr :environment) @@ -2651,8 +2654,7 @@ This function assumes TABLE has `org' as its `:type' property and '(0 nil)) (funcall same-mode-p prev)) (setq cluster-beg prev)) - (and (or (org-element-property :caption cluster-beg) - (org-element-property :name cluster-beg)) + (and (org-element-property :name cluster-beg) "\n\\end{equation}"))) (t "\\]"))))) -- 1.8.5.3 --=-=-=--