When I insert a formula it is shown properly. If I save the document as fodg, close and reopen it, then
the formula seems to have disappeared. By right click and doing “original size” where the formula should be, then it is shown as intended. Other formulas are distorted in size.
The issue can easily be reproduced, so I do not provide the file here.
If saved as odg everything is fine.
I’m using the latest version 7.6.4.1 (X86_64) on Linux 6.4.
Very strange. I looked at the .fodg before and after the “Original size” stance and I only see minor differences not involving formula size or text colour. I tried to modify the two styles involved to no avail. It may be a bug when reading the .fodg and not correctly interpreting something. What is weird is that the .odg is a zipped structured version of the .fodg which should be the same (except for the directory-structured organisation of the .odg). Submit a bug report so that a developer has a look at it.
BTW, never write “latest” because this highly depends on the platform and distribution (which you didn’t mention). Presently, my Fedora 39 is already at Linux 6.6.8 and LO 7.6.4.2. So, in the bug report, paste the information from Help
>About LO
for accurate designation.
It looks like tdf#76900
“FILESAVE: Flat XML format broken. Formula size not preserved in roundtrip.”
I wonder why no fix has been made after so many years.
The majority of users may use odg, but for those which have documents tracked by version control (like git), the fodg format is important.
Things get fixed only when someone fixes them. In this project, it is either a volunteer, who fixes what they feel interesting; or a paid developer, who fixes what their employer tells them (basically, what their paying customer wants fixed). Obviously, there was no developer who found it interesting, nor a paying customer who needed it fixed.
Which seems to mean that this is not important to those who have such documents in version control systems enough to sponsor a developer, and that there is no interested developer among those users
A formula is a separate OLE object in the .odg package. This OLE object has a content.xml file and a settings.xml file. When you change the font size via menu Format
> Font Sizes
> Base Size
this goes as config-item into this settings.xml. The content.xml of the document itself has only a reference to the OLE object.
When the document is saved in flat format as .fodg, the content.xml of the Math object is directly written into the file. There is no way to include the settings.xml of the Math object because the <office:settings>
element belongs to the document itself and has no means to restrict a part of it to a special element.
So when you use .fodg file format, you need to make all formatting directly in the formula and not as format setting. For the font size it means, that you use size 24 {your formula}
for example.
When you use the attribute size
it has further advantages:
- Other applications do not evaluate the settings.xml at all but only use the content.xml, which contains the MathML markup. The command
size 24
will generate a<mstyle mathsize="24pt">
MathML element and thus the font size can be used by other applications. - When you work with the Math module and save as
Math 2.0 (*.mml)
the generated file will contain the<mstyle mathsize="24pt">
element and when you include the *.mml markup into a website, browsers will use the specified font size.
So the solution for you is simple to not use the font size menu, but directly use the size attribute.