From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: Error in export to odt Date: Wed, 14 Nov 2012 18:16:51 +0530 Message-ID: <87ehjwgxms.fsf@gmail.com> References: <50A37BAE.5000609@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYcKX-00075S-8E for Emacs-orgmode@gnu.org; Wed, 14 Nov 2012 07:44:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TYcKU-0002mO-6H for Emacs-orgmode@gnu.org; Wed, 14 Nov 2012 07:44:33 -0500 Received: from mail-pb0-f41.google.com ([209.85.160.41]:43230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TYcKT-0002mE-W1 for Emacs-orgmode@gnu.org; Wed, 14 Nov 2012 07:44:30 -0500 Received: by mail-pb0-f41.google.com with SMTP id xa7so373477pbc.0 for ; Wed, 14 Nov 2012 04:44:28 -0800 (PST) In-Reply-To: <50A37BAE.5000609@gmail.com> (Rainer M. Krug's message of "Wed, 14 Nov 2012 12:08:30 +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: Rainer@krugs.de Cc: Emacs-orgmode@gnu.org Rainer M Krug writes: > Hi > > I am exporting a document to odt (Org-mode version 7.9.2 > (release_7.9.2-459-g6f7e92 @ > /home/rkrug/.emacs.d/org-mode/lisp/) and the odt generates fine, but > it is corrupt. The simple org > document looks like followed: > > #### > * Required data / field work > 100m^2--1000m2 > #### > > This results in a "Format error discovered in the file in sub-document > content.xml at 353,50(row,col)" > > simply adding spaces around the "--" solves the problem. Above example works fine with the new exporter. Old exporter is pretty much on the way out and I would strongly recommend that you use the new exporter as much as possible. (require 'org-e-odt) M-x org-export-dispatch RET That said, this is what happens. I will accept any suggestions for possible fix or blindly apply a patch if one would circulate that to me. Step 1. 100m^2--1000m2 Step 2. 100m^2–1000m2 Step 3. 100m2&#x2013;1000m2 Step 1 to Step 2 sounds good. This happens as part of `org-lparse-convert-special-strings'. Step 2 to Step is not OK. Note that the "&" that introduces the `ndash' gets pulled in as part of subscript. This happens as part of `org-lparse-apply-sub-superscript-styles'. Now `org-match-substring-regexp' which goes something like "\\([^\\]\\|^\\)\\([_^]\\)\\(\\({\\([^{}]*?\\|\\(?:[^{}]*?{[^{}]*?}\\)+[^{}]*?\\|\\(?:[^{}]*?{\\(?:[^{}]*?{[^{}]*?}\\)+[^{}]*?}\\)+[^{}]*?\\)}\\)\\|\\((\\([^()]*?\\|\\(?:[^()]*?([^()]*?)\\)+[^()]*?\\|\\(?:[^()]*?(\\(?:[^()]*?([^()]*?)\\)+[^()]*?)\\)+[^()]*?\\))\\)\\|\\(\\(?:\\*\\|[-+]?[^-+*!@#$%^_ \n,:\"?<>~;./{}=()]+\\)\\)\\)" looks like a swear word to me :-). Frankly, I don't know or care about latex-ism. I am not sure whether there is a bug in that regexp or the regexp is doing the right thing but that a `org-protected' property should be applied to some part of the string that is undergoing transformation. If someone can make sense out of what is happening and if I happen to trust the other person's judgment, then this bug has some hope of getting addressed. Otherwise, this bug will remain un-fixed. But, I am sure what a ndash is doing in a Math expression. May be it is a minus-that-is-aspiring-to-be-a-ndash, I don't know. Anyways, try the new exporter. One warning though: Make sure that you require ONLY ONE of org-odt and org-e-odt in your .emacs. If you require them simulatneously org-odt will not be usable. There is some error which I haven't had time to investigate. > I attach the tmp.odt with the error. > > Libre Office - Version 3.6.2.2 (Build ID: 360m1(Build:2)) > Ubuntu Quantal > > Cheers, > > Rainer --