emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [release_8.3beta-1062-gce4e64] Error when exporting to ODT
@ 2015-04-23  1:49 Vicente Vera
  2015-04-23 10:44 ` Rasmus
  0 siblings, 1 reply; 4+ messages in thread
From: Vicente Vera @ 2015-04-23  1:49 UTC (permalink / raw)
  To: emacs-orgmode

Hello list.

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.

Org and Emacs version:

Org-mode version 8.3beta (release_8.3beta-1062-gce4e64 @
/usr/local/share/emacs/site-lisp/org/)
GNU Emacs 24.5.50.1 (i686-pc-linux-gnu, GTK+ Version 3.4.2)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [release_8.3beta-1062-gce4e64] Error when exporting to ODT
  2015-04-23  1:49 [release_8.3beta-1062-gce4e64] Error when exporting to ODT Vicente Vera
@ 2015-04-23 10:44 ` Rasmus
  0 siblings, 0 replies; 4+ messages in thread
From: Rasmus @ 2015-04-23 10:44 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

Hi Vicente,

Thanks for catching another bug.

Vicente Vera <vicentemvp@gmail.com> 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!!!

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-odt-Fix-bug-links-without-labels.patch --]
[-- Type: text/x-diff, Size: 1485 bytes --]

From aad7dd24864f3ce988a67061a391d85e649aa375 Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus@gmx.us>
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 <vicentemvp@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/97090>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [release_8.3beta-1062-gce4e64] Error when exporting to ODT
@ 2015-04-23 15:29 Vicente Vera
  2015-04-24  7:47 ` Rasmus
  0 siblings, 1 reply; 4+ messages in thread
From: Vicente Vera @ 2015-04-23 15:29 UTC (permalink / raw)
  To: rasmus, emacs-orgmode

The patch works. Thank you.

About 2bdc661fde75ed226b19c802ecd31ce12d2ec7e1, I don't use
latexmlmath so can't comment on that.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [release_8.3beta-1062-gce4e64] Error when exporting to ODT
  2015-04-23 15:29 Vicente Vera
@ 2015-04-24  7:47 ` Rasmus
  0 siblings, 0 replies; 4+ messages in thread
From: Rasmus @ 2015-04-24  7:47 UTC (permalink / raw)
  To: vicentemvp; +Cc: emacs-orgmode

Vicente Vera <vicentemvp@gmail.com> writes:

> The patch works. Thank you.

Pushed.

-- 
What will be next?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-24  7:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-23  1:49 [release_8.3beta-1062-gce4e64] Error when exporting to ODT Vicente Vera
2015-04-23 10:44 ` Rasmus
  -- strict thread matches above, loose matches on Subject: below --
2015-04-23 15:29 Vicente Vera
2015-04-24  7:47 ` Rasmus

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).