From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [bug][ox-latex] Captions in equations Date: Sat, 25 Jan 2014 23:30:10 +0100 Message-ID: <8738kbvgnh.fsf@gmail.com> References: <87txd16q0s.fsf@gmx.us> <87iotg1ffu.fsf@gmail.com> <87zjms83dr.fsf@gmx.us> <87r483zrm8.fsf@gmail.com> <877g9ojfj6.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7Bje-0000DQ-RK for emacs-orgmode@gnu.org; Sat, 25 Jan 2014 17:30:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7BjZ-0004sx-0C for emacs-orgmode@gnu.org; Sat, 25 Jan 2014 17:29:54 -0500 Received: from mail-we0-x22f.google.com ([2a00:1450:400c:c03::22f]:43004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7BjY-0004sr-Ov for emacs-orgmode@gnu.org; Sat, 25 Jan 2014 17:29:48 -0500 Received: by mail-we0-f175.google.com with SMTP id p61so3903355wes.6 for ; Sat, 25 Jan 2014 14:29:48 -0800 (PST) In-Reply-To: <877g9ojfj6.fsf@gmx.us> (rasmus@gmx.us's message of "Sat, 25 Jan 2014 15:35:09 +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: Rasmus Cc: emacs-orgmode@gnu.org Hello, Rasmus writes: > 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. Thank you. Altering the parse tree seems a bit drastic to me, though. See below. > 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. We don't need to add "caption" to the default packages set. We can specify that this feature is available only if that package is required. > - (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)) We could replace (caption (org-latex--caption/label-string ...)) with (label (let ((label (org-element-property :name table))) (and label (format "\\label{%s}\n" (org-export-solidify-link-text label))))) and change "caption" into "label" later in the function. WDYT? Regards, -- Nicolas Goaziou