emacs-orgmode
[Top][All Lists]

## Re: [O] [odt] equation labels

 From: Jambunathan K Subject: Re: [O] [odt] equation labels Date: Wed, 02 Nov 2011 01:09:41 +0530 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (windows-nt)

Myles

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

>>> On Mon, 31 Oct 2011 03:41:18 +0530, Jambunathan K said:
>
>   > Myles English <address@hidden> 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
>
> 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. > > > e = \frac{1}{2}mv^2 > > > ** LaTeX Fragment2 > > #+CAPTION: Radicals > #+LABEL: Equation:1 > > x=\sqrt{b} > > > If a^2=b and $$b=2$$, then the solution must be either$$
>    a=+\sqrt{2}  or $a=-\sqrt{2}$.
>
>
> Myles
>
>

--

`
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 2, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7328833937644958, "perplexity": 26593.771298105974}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-22/segments/1464049275764.90/warc/CC-MAIN-20160524002115-00061-ip-10-185-217-139.ec2.internal.warc.gz"}