Bug 436608 - oolatex generates syntactically incorrect ooffice equations when operators are used to name entities
oolatex generates syntactically incorrect ooffice equations when operators ar...
Product: Fedora
Classification: Fedora
Component: tetex-tex4ht (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Patrice Dumas
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-03-08 04:31 EST by Leo Lopes
Modified: 2008-04-14 01:10 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-04-14 01:10:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
output of oolatex testHtlatex.tex (16.28 KB, text/plain)
2008-04-10 18:27 EDT, Leo Lopes
no flags Details

  None (edit)
Description Leo Lopes 2008-03-08 04:31:42 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20080208 Fedora/ Firefox/ pango-text

Description of problem:
Consider the following latex variable definition:


In latex, '+' is just a glyph, but in ooffice, '+' is an operator and all operators must have operands. So tex4ht's translation of the above equation to oomath, which is this:


is incorrect, since the '+' is an operator in oomath. Of course, the user probably meant "positive part of x" when they wrote that latex expression. The correct way to express this in oomath is:

x^{ {} + {} }

with the empty {} taking the place of the operators for '+'.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create a basic latex file, say "myfile.tex".
2. In the main document part, enter '$x^{+}$
3. run oolatex myfile.tex
4. open myfile.odt in Open Office

Actual Results:
You get red question marks in the generated equations, indicating syntax errors.

Expected Results:
The output in oomath should match the output in latex, with the exception of details like which font is used.

Additional info:
Seems like an easy fix, but in the meantime, the following workaround should do:

Since oomath has a nice text-based editor, cut and paste the expressions generated by oolatex into your favorite editor, and do a pattern matching replacement of {+} (including potentially spaces) by {{}+{}}.
Comment 1 Patrice Dumas 2008-03-08 09:08:58 EST
This seems to be fixed in tetex-tex4ht in devel. I'll update.
Comment 2 Fedora Update System 2008-03-09 11:23:24 EDT
tetex-tex4ht-1.0.2007_12_19_2154-2.fc7.2 has been submitted as an update for Fedora 7
Comment 3 Fedora Update System 2008-03-09 11:33:13 EDT
tetex-tex4ht-1.0.2007_12_19_2154-2.fc8.1 has been submitted as an update for Fedora 8
Comment 4 Fedora Update System 2008-03-13 03:43:11 EDT
tetex-tex4ht-1.0.2007_12_19_2154-2.fc8.1 has been pushed to the Fedora 8 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update tetex-tex4ht'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F8/FEDORA-2008-2413
Comment 5 Fedora Update System 2008-04-09 01:20:27 EDT
tetex-tex4ht-1.0.2007_12_19_2154-2.fc7.2 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 6 Leo Lopes 2008-04-10 14:59:03 EDT
I am afraid that this version does not seem to produce readable odt files at all. 

oolatex complains that it can't find a file sxw-myfile.dir, and creates a large
number of files in the local directory. 

There is still an odt file created, but Openoffice can't open it, and complains
of an Input/Output error.
Comment 7 Patrice Dumas 2008-04-10 16:37:50 EDT
Could you please send the oolatex output? sxw-myfile.dir should be created and
things put in. It is normal that it creates files in the directory, it is a
latex run, after all.
Comment 8 Leo Lopes 2008-04-10 18:27:05 EDT
Created attachment 302082 [details]
output of oolatex testHtlatex.tex

The file I used to test oolatex is also attached. The xml error ("no root
element") jumps out.
Comment 9 Patrice Dumas 2008-04-11 09:55:31 EDT
It works for me. Since the error appears in Saxon, my first guess is that this
is a bug in Saxon (maybe the oolatex generated xml is not fully correct and
different Saxon versions are not similarly strict).

Do you knwow which java you are using? I found out that I am using openjdk:
ls -l /etc/alternatives/java
/etc/alternatives/java -> /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
Comment 10 Leo Lopes 2008-04-11 14:33:04 EDT
I am using

 /etc/alternatives/java -> /usr/lib/jvm/jre-1.5.0-gcj/bin/java

which is what is shipped with standard fedora:

me@mypc ~]$ rpm -q --whatprovides /usr/lib/jvm/jre-1.5.0-gcj/bin/java

In any case, even if the source of the error is saxon, shouldn't the behavior of
oolatex be different?
Comment 11 Patrice Dumas 2008-04-11 18:39:16 EDT
I contacted upstream and he cannot fix it before summer. But maybe it is
possible to force using openjdk ono F-7? Is it available in F-7?
Comment 12 Leo Lopes 2008-04-11 20:51:10 EDT
I just searched some mirrors and openjdp is not in the FC7 distro as far as I
can tell.
Comment 13 Fedora Update System 2008-04-13 19:01:09 EDT
tetex-tex4ht-1.0.2008_02_28_2058-3.fc8.1 has been submitted as an update for Fedora 8
Comment 14 Patrice Dumas 2008-04-13 19:04:05 EDT
It should be fixed in F-9 and in F-8 when icedtea is present. But for F-7, the
only way I see is to have a sun jre be added to the distribution, but I guess
that it won't happen because F-7 won't be maintained for a long time.

A possible workaround may be to install the icedtea java package from F-8, it
may work, but I haven't tested.
Comment 15 Leo Lopes 2008-04-14 01:10:19 EDT
Thanks for all your help. I guess the bug is resolved? If F8 makes the Java
situation less complex that is good enough reason to upgrade by itself.

I marked the bug as resolved, NEXTRELEASE. I wasn't sure if that was more
appropriate than CANTFIX but it seemed more informative.

Thanks again.

Note You need to log in before you can comment on or make changes to this bug.