emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [odt] equation labels
Date: Wed, 02 Nov 2011 01:09:41 +0530	[thread overview]
Message-ID: <818vnz639e.fsf@gmail.com> (raw)
In-Reply-To: <8739e9nzpg.fsf@gmail.com> (Myles English's message of "Mon, 31 Oct 2011 11:54:35 +0000")


Myles

(I have read the followup post to this set of questions)

Myles English <mylesenglish@gmail.com> writes:
>>> On Mon, 31 Oct 2011 03:41:18 +0530, Jambunathan K said:
>
>   > Myles English <mylesenglish@gmail.com> 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.

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.")
`----


> 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?

> Just to be explicit, the test file latex-mathml.org I am referring to
> contains:
>
> #+TITLE:     latex-mathml.org
> #+AUTHOR:    Jambunathan K
> #+EMAIL:     address@hidden
> #+DATE:      2011-09-09 Fri
> #+DESCRIPTION:
> #+KEYWORDS:
> #+LANGUAGE:  en
> #+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
> #+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
>
> #+EXPORT_SELECT_TAGS: export
> #+EXPORT_EXCLUDE_TAGS: noexport
> #+LINK_UP:   
> #+LINK_HOME: 
> #+XSLT:
>
> * LaTeX Fragments
>
> ** LaTeX Fragment1
> #   See org-format-latex-options
>
>     There is a equation down below.
>
>    \begin{equation}
>      e = \frac{1}{2}mv^2
>    \end{equation}
>
> ** LaTeX Fragment2
>
> #+CAPTION: Radicals
> #+LABEL: Equation:1
>    \begin{equation}
>    x=\sqrt{b}
>    \end{equation}
>
>    If $a^2=b$ and \( b=2 \), then the solution must be either $$
>    a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \].
>
>
> Myles
>
>

-- 

  parent reply	other threads:[~2011-11-01 19:40 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28  1:23 [odt] equation labels Myles English
2011-10-30 22:11 ` Jambunathan K
2011-10-31 11:54   ` Myles English
2011-11-01 11:17     ` Myles English
2011-11-01 19:39     ` Jambunathan K [this message]
2011-11-01 19:49       ` Jambunathan K
2011-11-02 13:18       ` Myles English
     [not found]         ` <mylesenglish@gmail.com>
2011-11-02 13:38           ` Nick Dokos
2011-11-02 14:49             ` Myles English
2011-11-02 14:52           ` Nick Dokos
2011-11-02 18:21             ` Jambunathan K
2011-11-02 21:33               ` Myles English
  -- strict thread matches above, loose matches on Subject: below --
2013-01-23  2:47 session with python-mode.el complains of void py-toggle-shells Myles English
2013-01-23  4:11 ` Nick Dokos
2013-01-23 12:46   ` [PATCH] " Myles English
2013-01-23 13:04     ` Bastien
2013-01-23 18:02       ` Andreas Röhler
2013-01-24 14:10         ` Bastien
2013-02-21 20:08           ` Andreas Röhler
2013-02-22  8:25           ` Andreas Röhler
2013-02-23  9:29             ` Bastien
2013-01-23 13:00   ` Bastien
2011-08-23 14:36 [odt] equation labels Myles English
2011-08-26 19:36 ` Jambunathan K
2011-08-27 22:02 ` Jambunathan K
2011-08-31 11:09   ` Myles English
2011-08-31 11:37     ` suvayu ali
2011-08-31 11:50     ` Myles English
2011-08-31 13:52       ` Jambunathan K
2011-08-31 14:07     ` Jambunathan K
2011-09-17 19:48 ` Jambunathan K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=818vnz639e.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).