Greek letters replaced in equation editor

Discuss the word processor
Post Reply
cpede
Posts: 8
Joined: Mon Nov 06, 2017 11:03 am

Greek letters replaced in equation editor

Post by cpede »

I'm trying to use LibreOffice Writer to open an old MS Word 2000 document with equations.

Basically it works, but not entirely.

When opening the MS Word 2000 document in LibreOffice Writer all the formulas looks OK at first. But when I try to enter the formula editor in LibreOffice Writer the Greek letters changes to "normal" letters.
Before and after entering the Math editor.
Before and after entering the Math editor.
LibraOffice Greek Math Error.png (4.11 KiB) Viewed 5688 times
The top shows the correct equation, and the lower part the wrong equation after double-clicking to enter the formula editor. Now the Greek letter "Phi" is replaced by the normal letters "j".

Using Windows 10 (x64), LibreOffice Writer 5.4.2.2 (x64), and MS Word 2000.

Any suggestions?

-cpede
Last edited by cpede on Mon Nov 06, 2017 9:24 pm, edited 2 times in total.
LibreOffice 5.4 on Windows 10
User avatar
keme
Volunteer
Posts: 3699
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Greek letters replaced in equation editor

Post by keme »

Can you upload a doc file with the two objects, so we can have a go at the actual problem?
We don't need your entire file (no worries if it is something confidential). Just copy/paste the objects you have already disclosed.
cpede
Posts: 8
Joined: Mon Nov 06, 2017 11:03 am

Re: Greek letters replaced in equation editor

Post by cpede »

Sure:
LibraOffice Greek Math Error.DOC
Small sample Word 2000 file with the equations.
(34.5 KiB) Downloaded 227 times
-cpede
LibreOffice 5.4 on Windows 10
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Greek letters replaced in equation editor

Post by FJCC »

The file looks correct in OpenOffice 4.1.4
Equations.JPG
Equations.JPG (11.17 KiB) Viewed 5674 times
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
cpede
Posts: 8
Joined: Mon Nov 06, 2017 11:03 am

Re: Greek letters replaced in equation editor

Post by cpede »

Also when you double-click to edit the formula?

-cpede
LibreOffice 5.4 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Greek letters replaced in equation editor

Post by RoryOF »

Check that font Symbol is available on your computer.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
cpede
Posts: 8
Joined: Mon Nov 06, 2017 11:03 am

Re: Greek letters replaced in equation editor

Post by cpede »

Where do I see the fonts used for formulas in LibreOffice Writer?

-cpede
Last edited by cpede on Mon Nov 06, 2017 9:25 pm, edited 1 time in total.
LibreOffice 5.4 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Greek letters replaced in equation editor

Post by RoryOF »

Use Control Panel , Fonts to see if the font is installed on the computer.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
cpede
Posts: 8
Joined: Mon Nov 06, 2017 11:03 am

Re: Greek letters replaced in equation editor

Post by cpede »

But where do I see what font it tries to use?
LibreOffice 5.4 on Windows 10
User avatar
keme
Volunteer
Posts: 3699
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Greek letters replaced in equation editor

Post by keme »

With the formula editor open, see menu Format - Fonts. This shows the font used for textual content (roman lettering). For greek lettering, mathematical operators, etc., I believe the Symbol font will always be used by Math.

It looks to me like you have inserted the φ character verbatim (by copy/paste?). Using the %phi token is probably more reliabe.

If the formula objects originated from MS equation editor, MathType or other formula editing apps, they may in theory request a different font. I do not know the inner workings of "Math" well enough to say how it would react to such objects, but I know that translation between MS and OpenOffice storage formats is not perfect.
Last edited by keme on Mon Nov 06, 2017 8:44 pm, edited 1 time in total.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Greek letters replaced in equation editor

Post by acknak »

Have I missed something? Do you not use the named Greek letters in the formula code: %PHI, for example?

Embedding specific Unicode characters for the symbols may not be the best approach (I don't know).
AOO4/LO5 • Linux • Fedora 23
cpede
Posts: 8
Joined: Mon Nov 06, 2017 11:03 am

Re: Greek letters replaced in equation editor

Post by cpede »

I don't know how the original MS Word 2000 document was created. I think that the Greek letters is selected from a toolbar menu in the Equation Editor in MS Word 2000. It is not like LaTex or MathXL where you write the code yourself.

However my original problem was with LibreOffice Writer and not OpenOffice Writer (what is the difference?)

If I use OpenOffice Writer the original Phi Greek letter seems to work sometimes. But most of the formulas does not convert correctly and just shows a read cross?

In LibreOffice Writer all formulas are initially converted correctly, but fails to show the Phi Greek letter when edited.

Also when saving as ODT file from LibreOffice Writer the formulas are correctly converted into DOCX Word format when opened in MS Word 2013, whereas the ODT file from OpenOffice Writer does not seem to convert the formulas correctly to MS Word 2013 format.

This brings me back to my unsolved question about LibreOffice Writer and Greek fonts in the equation editor.

-cpede
LibreOffice 5.4 on Windows 10
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Greek letters replaced in equation editor

Post by RoryOF »

One can list the fonts used and missing in an OpenOffice/LibreOffice file by installing the extension TestFonts; I doubt that this will list fonts used in the equation editor.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Greek letters replaced in equation editor

Post by Zizi64 »

Libreoffice 5.3.6 on Win7 64 bit, and the Test fonts extension:
Attachments
Missing Symbol font...
Missing Symbol font...
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
jrkrideau
Volunteer
Posts: 3816
Joined: Sun Dec 30, 2007 10:00 pm
Location: Kingston Ontario Canada

Re: Greek letters replaced in equation editor

Post by jrkrideau »

I am getting the same result when I try to edit either equation. I almost never use the equation editor but in looks to me that if have the equation mode you can go to Format > Fonts to see what font is being used. My Ubuntu system seems to feel I am using Liberation Serif, Italic. I don't have Times Roman or Symbol fonts but should not any UTF-8 font have a basic Greek character set?


I can get the Greek letter with a %alpha or by using the Symbol button. I suspect that you are running into some MS Word feature though it could be a translator bug.


General Question for regular equation editor users:
The imported code for the first equation is

Code: Select all

 size 12{j rSub { size 8{r} } "=-" {j}  rSub { size 8{i} } } {}
for the first equation. Are MS equations typically this verbose?
I seem to be able to write basically the same thing in the Writer editor as
%phi_r = -%phi_i
LibreOffice 7.3.7. 2; Ubuntu 22.04
User avatar
Zizi64
Volunteer
Posts: 11353
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Greek letters replaced in equation editor

Post by Zizi64 »

but should not any UTF-8 font have a basic Greek character set?
The Symbol font (was) a separated character set, and (I suppose) the ASCII code of the letter "j" represented the greek letter "phi".

Two solutions are available:
- Install the old, obsolete font (if you use the document on that one PC only - because other people have not that font - as you have not...)
- Use a modern UTF-8 font, and replace the old formatting properties and the wrongly coded letters from the document.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Lupp
Volunteer
Posts: 3542
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Greek letters replaced in equation editor

Post by Lupp »

I cannot analyze the .doc file. If I convert it to .odt and look inside the file already has two internal content.xml in wrapped-in subfolders for the formula objects that were created. These subfiles already contain the j instead of anything that may have been placed there by MathType.
The appearance of a formula with the correct greek letters when the document is first opened is the result of graphic replacements for the formulas included with the file. As soon as you open the formulas for editing the replacements are gone and the true content is shown.

The problem seems not to be one of font replacement or of a missing font, but one of the conversion from the reduced MathType of Word to MathML of OpenDocumentFormat.
The code I found for the first formula while the opened file still showed the formulas with lower case phi :

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
	<semantics>
		<mrow>
			<mstyle mathsize="12pt">
				<mrow>
					<msub>
						<mi>j</mi>
						<mstyle mathsize="8pt">
							<mi>r</mi>
						</mstyle>
					</msub>
					<mtext>=-</mtext>
					<msub>
						<mi>j</mi>
						<mstyle mathsize="8pt">
							<mi>i</mi>
						</mstyle>
					</msub>
				</mrow>
			</mstyle>
			<mrow/>
		</mrow>
		<annotation encoding="StarMath 5.0"> size 12{j rSub { size 8{r} } "=-" {j}  rSub { size 8{i} } } {}</annotation>
	</semantics>
</math>
(I don't understand at all the non-italic variables in the preview of the second formula. )

There are some related bug reports in https://bugs.documentfoundation.org
You may want to look there and to contribute to the discussion.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
cpede
Posts: 8
Joined: Mon Nov 06, 2017 11:03 am

Re: Greek letters replaced in equation editor

Post by cpede »

In the old DOC document open with Word 2000, I can see the font assignments to the Equation Editor.
Word 2000 Greek Math Fonts Defines.
Word 2000 Greek Math Fonts Defines.
Word 2000 Greek Math Fonts.png (6.86 KiB) Viewed 5555 times
Here the LC and UC Greek letters are using the standard Windows System font.

So, somehow the LibreOffice Writer fails to convert Symbol fonts correctly in equations?

Is this a bug?
LibreOffice 5.4 on Windows 10
User avatar
keme
Volunteer
Posts: 3699
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Greek letters replaced in equation editor

Post by keme »

cpede wrote:... , somehow the LibreOffice Writer fails to convert Symbol fonts correctly in equations?

Is this a bug?
Most likely you could call it that. It is clearly a shortcoming. It is hard to say whether it is caused by a mistake in the programming of OO import filters or a deviation in the way things are stored by this particular version of MS Office.

Did you insert phi by toolbox icon, or was it pasted as a character? (Possible workaround: Try the other option.)

The MS Office version in question is six generations back from the current, so I wouldn't expect this problem to be addressed by developers any time soon...
Looking for workarounds is your best bet.
cpede
Posts: 8
Joined: Mon Nov 06, 2017 11:03 am

Re: Greek letters replaced in equation editor

Post by cpede »

The problem is that in MS Word 2000 you can only select the Greek letters from the toolbar icons. You have no way to manually type LaTeX kind of \phi code for the equations.

So LibreOffice Writer should look for the system font and for Greek letters and convert these into either clever LaTeX codes or into Unicode numbers.

Another funny thing is that OpenOffice Writer does not initially have this problem, since it is not converting the MS Word 2000 equations into MathML/LaTeX code when it opens,
but keeps the equations in Equation Object format.

So LibreOffice Writer does something extra with equations, by converting them into MathML/LaTeX code, and with a little more effort, it should be possible to convert it correctly.
LibreOffice Math Fonts Dialog.
LibreOffice Math Fonts Dialog.
LibraOffice Math Fonts.png (10.4 KiB) Viewed 5509 times
If you compare the MS Word 2000 font dialog to the above dialog from LibreOffice Writer it is clear that the Greek letters specification is missing. If this could be identified and
added to this dialog as Symbol fonts it should be possible to make it work.

-cpede
LibreOffice 5.4 on Windows 10
Post Reply