From mboxrd@z Thu Jan 1 00:00:00 1970 From: Myles English Subject: Re: [odt] equation labels Date: Wed, 02 Nov 2011 13:18:17 +0000 Message-ID: <87ipn2slwm.fsf@gmail.com> References: <87y5w5aoyx.fsf@gmail.com> <81ipn6f7uh.fsf@gmail.com> <8739e9nzpg.fsf@gmail.com> <818vnz639e.fsf@gmail.com> Reply-To: emacs-orgmode@gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:36403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLagB-0005i5-AT for emacs-orgmode@gnu.org; Wed, 02 Nov 2011 09:16:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLag5-0008GA-TY for emacs-orgmode@gnu.org; Wed, 02 Nov 2011 09:16:31 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:33767) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLag5-0008G3-JZ for emacs-orgmode@gnu.org; Wed, 02 Nov 2011 09:16:25 -0400 Received: by wyg24 with SMTP id 24so164599wyg.0 for ; Wed, 02 Nov 2011 06:16:24 -0700 (PDT) In-Reply-To: <818vnz639e.fsf@gmail.com> (Jambunathan K.'s message of "Wed, 02 Nov 2011 01:09:41 +0530") 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 Jambunathan, >> On Wed, 02 Nov 2011 01:09:41 +0530, Jambunathan K said: > Myles > (I have read the followup post to this set of questions) > Myles English writes: >>>> On Mon, 31 Oct 2011 03:41:18 +0530, Jambunathan K said: >> >> > Myles English writes: >> I have found >> that Equations become labelled as Figures in the >> version I am >> using: >> >> >> >> emacs 23.3.1 org-mode from git commit 71f1c1be (Oct 26) The test >> >> equations in latex-mathml.org in this message: >> >> >> >> >> http://lists.gnu.org/archive/html/emacs-orgmode/2011-09/msg00198.html >> >> >> >> are labelled as "Equation" in the odt files but when I export it >> >> fresh I get "Figure". >> >> > This was a regression. I pushed a fix few moments ago. Could you >> > please pull again? >> >> Thanks for the push, there are three things I notice now: >> >> 1) my document won't open and causes libreoffice to crash! I get: >> "terminate called after throwing an instance of what(): >> vector::_M_default_append" on the command line > 1. You are using custom styles for your latex fragment > 2. latex-to-mathml converter - as it stands today - assumes the > latex fragment is completed in and of itself and doesn't honor the > style settings. > Putting 1 and 2 together, I am assuming that the XML created by the > ODT emitter contains garbage which is causing LibreOffice to be > confused. In my observation, ill-formed XML triggers "file is > corrupt and should I repair the file?" from LibreOffice. A crash > seems strange to me. There is (git from a couple of days ago) a problem with referring to equations containing an underscore in the label, I am fairly sure it was allowed before, e.g.: --8<---------------cut here---------------start------------->8--- #+LABEL: Equation:new_eq \begin{equation} x=\sqrt{b} \end{equation} Referring to an equation with an underscore: \ref{Equation:new_eq} --8<---------------cut here---------------end--------------->8--- I get a libreoffice popup: "Read Error. Format error discovered in the file in sub-document content.xmlat 2236,92(row,col)." I think it was many of these errors that caused the crash. > 1. http://article.gmane.org/gmane.emacs.orgmode/48714 - Above link > has my note on -ncf option to mathtoweb > 2. http://orgmode.org/worg/org-faq.html - Above link has a note on > how to debug corrupt odt files. (Hint: search for corrupt) >> 2) the first equation in latex-mathml.org is not numbered, I would >> expect this if it was using a begin{equation*} environment but not >> a begin{equation}. > Currently the odt exporter doesn't peek in to the latex fragment and > infer what manner of equation it is. This is something that I could > take up ... > ,---- | (defvar org-latex-regexps | '(("begin" "^[ > \t]*\\(\\\\begin{\\([a-zA-Z0-9\\*]+\\)[^\000]+?\\\\end{\\2}\\)" 1 t) > | ;; ("$" "\\([ (]\\|^\\)\\(\\(\\([$]\\)\\([^ > \r\n,.$].*?\\(\n.*?\\)\\{0,5\\}[^ \r\n,.$]\\)\\4\\)\\)\\([ > .,?;:'\")]\\|$\\)" 2 nil) | ;; \000 in the following regex is needed > for org-inside-LaTeX-fragment-p | ("$1" "\\([^$]\\|^\\)\\(\\$[^ > \r\n,;.$]\\$\\)\\([- .,?;:'\")\000]\\|$\\)" 2 nil) | ("$" > "\\([^$]\\|^\\)\\(\\(\\$\\([^ > \r\n,;.$][^$\n\r]*?\\(\n[^$\n\r]*?\\)\\{0,2\\}[^ > \r\n,.$]\\)\\$\\)\\)\\([- .,?;:'\")\000]\\|$\\)" 2 nil) | ("\\(" > "\\\\([^\000]*?\\\\)" 0 nil) | ("\\[" "\\\\\\[[^\000]*?\\\\\\]" 0 > nil) | ("$$" "\\$\\$[^\000]*?\\$\\$" 0 nil)) | "Regular expressions > for matching embedded LaTeX.") `---- Crikey! That's quite a regexp. I think the only consideration is whether you want it to be consistent with pdf export. Taking consistency to an extreme could lead to a new #+begin_equation block (<-- I haven't thought this through at all). Having said that I am happy with the way it works at the moment. >> 3) the second equation looks a bit like this: >> >> x=root(b) (1) Radicals >> >> but I would have expected something like: >> >> x=root(b) Equation 1.: Radicals >> >> Is there a new variable that I need to set to get (e.g.) "Equation >> 1."? > Being a non-latex user, I am not familiar with what the usual > practice is. If the latter option is how captioned equations are > normally typeset I can take it up. Can you confirm that the > expectations above are *not* your own but that of *any* user? Actually I have changed my mind, it does look better like that, it is just that is was different behaviour to what happened before. Myles