Nicolas,

Nicolas Goaziou <n.goaz...@gmail.com> 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.

–Rasmus

-- 
ツ
>From 3470c44a7ef48a92848c39741b25e7c7cf0dddf8 Mon Sep 17 00:00:00 2001
From: Rasmus <w...@pank.eu>
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

Reply via email to