Bug 436608

Summary: oolatex generates syntactically incorrect ooffice equations when operators are used to name entities
Product: [Fedora] Fedora Reporter: Leo Lopes <lleeoo>
Component: tetex-tex4htAssignee: Patrice Dumas <pertusus>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 7CC: jnovy
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-14 05:10:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
output of oolatex testHtlatex.tex none

Description Leo Lopes 2008-03-08 09:31:42 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080208 Fedora/2.0.0.12-1.fc7 Firefox/2.0.0.12 pango-text

Description of problem:
Consider the following latex variable definition:

$x^{+}$

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:

x^{+}

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):
tetex-tex4ht-1.0.2006_10_28_1705-1.fc7

How reproducible:
Always


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 14:08:58 UTC
This seems to be fixed in tetex-tex4ht in devel. I'll update.

Comment 2 Fedora Update System 2008-03-09 15:23:24 UTC
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 15:33:13 UTC
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 07:43:11 UTC
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 05:20:27 UTC
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 18:59:03 UTC
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 20:37:50 UTC
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 22:27:05 UTC
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 13:55:31 UTC
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 18:33:04 UTC
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
java-1.5.0-gcj-1.5.0.0-14.fc7

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 22:39:16 UTC
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-12 00:51:10 UTC
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 23:01:09 UTC
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 23:04:05 UTC
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 05:10:19 UTC
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.
Leo.