From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [release_8.3beta-1062-gce4e64] Error when exporting to ODT Date: Thu, 23 Apr 2015 12:44:46 +0200 Message-ID: <87egnb3yzl.fsf@gmx.us> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlEcv-0003yr-FP for emacs-orgmode@gnu.org; Thu, 23 Apr 2015 06:45:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlEcs-0007sM-5a for emacs-orgmode@gnu.org; Thu, 23 Apr 2015 06:45:01 -0400 Received: from plane.gmane.org ([80.91.229.3]:58821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlEcr-0007sG-VR for emacs-orgmode@gnu.org; Thu, 23 Apr 2015 06:44:58 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YlEco-0006lG-Ro for emacs-orgmode@gnu.org; Thu, 23 Apr 2015 12:44:54 +0200 Received: from 46.166.188.207 ([46.166.188.207]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 23 Apr 2015 12:44:54 +0200 Received: from rasmus by 46.166.188.207 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 23 Apr 2015 12:44:54 +0200 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 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hi Vicente, Thanks for catching another bug. Vicente Vera writes: > Just tried to export an Org file to ODT but this error appeared (taken > from the Messages buffer): > > ... > LaTeX to MathML converter not available. > Formatting LaTeX using verbatim > OpenDocument export failed: Assertion failed: (funcall predicate element info) > > Tried with a MWE and with a minimal init.el (because of > org-export-backends and the "odt" symbol) but the error persists. Yeah, my guess is that the error is in org-odt-format-label. It used to be that an inline formula would not have a label. But now it does. So label is non-nil. The attached patch seems to fix it, but org-odt-format-label is pretty fragile in its assumptions... I also pushed a fix to org.el that may be related if you e.g. use latexmlmath. For the record, it can be reproduced with the following example from emacs -q. —Rasmus * set up :noexport: #+BEGIN_SRC emacs-lisp (require 'ox-odt) (setq org-latex-to-mathml-convert-command "latexmlmath \"%i\" --presentationmathml=%o") #+END_SRC * test see \(x\) -- Don't panic!!! --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ox-odt-Fix-bug-links-without-labels.patch >From aad7dd24864f3ce988a67061a391d85e649aa375 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Thu, 23 Apr 2015 12:35:43 +0200 Subject: [PATCH 1/2] ox-odt: Fix bug links without labels. * ox-odt.el (org-odt-format-label): Determine label more carefully. Reported-by: Vicente Vera --- lisp/ox-odt.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el index a8544a4..faf0b1c 100644 --- a/lisp/ox-odt.el +++ b/lisp/ox-odt.el @@ -2152,13 +2152,15 @@ Return value is a string if OP is set to `reference' or a cons cell like CAPTION . SHORT-CAPTION) where CAPTION and SHORT-CAPTION are strings." (assert (memq (org-element-type element) '(link table src-block paragraph))) - (let* ((caption-from + (let* ((element-or-parent (case (org-element-type element) (link (org-export-get-parent-element element)) (t element))) ;; Get label and caption. - (label (org-export-get-reference element info)) - (caption (let ((c (org-export-get-caption caption-from))) + (label (and (or (org-element-property :name element) + (org-element-property :name element-or-parent)) + (org-export-get-reference element-or-parent info))) + (caption (let ((c (org-export-get-caption element-or-parent))) (and c (org-export-data c info)))) ;; FIXME: We don't use short-caption for now (short-caption nil)) -- 2.3.6 --=-=-=--