Measurements automatically changing

This mainly happens in writer. If I set the grid size to 5.00 mm for example, it changes to 4.99 after I confirm the change. This also happens while setting up margins and object dimensions. 1.00 can turn to 1.01 or 0.99 sometimes.

Is this a problem thatā€™s going to be fixed? Seems like it has been going on for a very long timeā€¦

No (at least in the near future). If you read my explanations in the second link, you will see that itā€™s quite deep, in the API (using mm/100 as a unit, and it canā€™t change), and in the document model (using twips, also very difficult to change).

Just curious, if the api uses 100th of mm as a unit, why canā€™t it differentiate between 0,49 and 0,50 mm?

Because mm/100 is not the only unit internally. Your input is converted to twips in/1440 and back.

Copied from the linked bug-report as example:

12.00mm = 680.3149ā€¦ Twips ā‰ˆ 680 Twips
680 Twips = 11.9944ā€¦ mm ā‰ˆ 11.99 mm

And if you read the bug-report somebody even predicted your questionā€¦

I am sorry, now I am confused even more. Twip seems to be an even more accurate unit than mm (since it is smaller). So, if LibreOffice settings let me choose twips as a unit, then I could come very very close to mm if I wanted to?
Also, even the way things are, does it make any realistic difference if something is set to 4.99 instead of 5.00?

In some situations 0.01 mm is significant, I donā€™t think this is one of those.

0.01 mm is around 10% - 20% the thickness of a hair. It is much less than the accuracy of a printer (600 DPI divided by 4 CMYK colours = around 0.17 mm dot), or even the paper dimensions which will vary depending on humidity. There is more rounding when it gets displayed on a screen measured in pixels and a percentage of each colour pixel (RGB) gets lit.

But it is no choice. The internal proceedings of LibreOffice inherited the usage of both. Changing this would be a bigger task to locate all necessary places (in all parts of LO), change them and remove the bugs at places where something relied on twips/mm without telling ā€¦ Adapt documentation and unit-tests comes on top.

5.00 mm is 283.4646 twip. In LibreOffice internals, integer twips are used, so that would be converted to 283 twip, which is 4.9918 mm. When the 283 twip will be shown to you as mm, you will see 4.99 mm.

On the other hand, if you used twips directly, you could only use integer values anyway. Since 283 twip is less than 5 mm, you could try 284 twip. That is 5.0094 mm, which would show as 5.01 mm.

Ergo, there is no integer size in twip, which matches 5 mm with precision of 0.01 mm.

1 Like

So, all in all, does this make LibreOffice less accurate than its Microsoft counterpart? For some reason, LO always felt more accurate to me. I realize that the way things currently are, I cannot get to 5mm if I actually use mm as a unit. But what if I used points instead as a unit of measurement?
14.17 pt would equal 4.9988611 mm which is practically 5.00.
However, when I set pt as a unit, I cannot edit hundredths as it rounds to tenthsā€¦ Which makes sense if the internal unit is set to twips.
As to why LO chose a non-decimal unit for all these measurements is beyond me.

?? Do you really set the height of your fonts in mm? I use pt in all programs (except some illustrative work, where I filled some frame). So I derive from there line-height and will consider this when planning margins and distance between paragraphs. As point is related to/derived from inch not mm twips is/was a logical choice here.

You need to check that carefully. At first LibreOffice is maybe more honest now on limitations, as it exposes this. Remember the problem only shows, because LO gives more decimals now. Office suites know a lot of tricks to hide internals, so check what Word is really doing hereā€¦
.
The main question is: Does this matter? In professional printing we use additional cutting marks and bleed, because we know the machines wil not print perfectly to calczuated dimensions, so enhancing calculations would not help with the result. If you can see a ragged justfication against the calculated margin, this would be a problem. If all pages are printed with margin 4.99 mm instead of 5.00 this should barely be noticed.
.
So before thinking on calculations, test precision of the used printer (I do print some two-sided labels, so I know this is a nice playground) and obviously calibrate size of your monitor accordingly. Maybe try generating a mm-gridā€¦

Well, I use pt for fonts. But for other things, creating margins or controlling dimensions of other objects I do use mm.

So, I guess this is not limited to LO then. What internal units would Microsoft Office use?
And by the way, this standard is already set and unlikely to be changed, right?

It depends.

MS Office uses EMUs (ā€œEnglish Metric Unitsā€) in its DrawingML. These units provide many times greater precision (1/36ā€™000th of a millimeter). If only they used it consistently!

In other places, they use other units: they may be twips; or points; or quarters of pointsā€¦

And sometimes, they use esoteric units like ā€œaverage width of a character of the default font used in the spreadsheetā€.

I do hope that Libre Office also moves towards something more accurate, but as I see it, they are unlikely to change it.

Why? What is your use-case for this?
Re-read the comment above by @EarnestAl . Even with more precise calculation your printer or screen can not show this, but will round/trunc to 300dpi/600dpi etc (Non metric again. Check buying you next printer to respect mmā€¦)
.
Maybe printers should write log-files to the screen to show actual precision. Would be a long list.

I think I got some things wrong. 300 DPI means 25.4 mm / 300 = 0,085 mm. So, 300 DPI already produces dots half the length of a twip. And 600 DPI would produce a quarter of its length?
On a slightly unrelated note, what is MS Officeā€™s reasoning behind using English metric units which offers much more precision if it has no meaning?

Maybe check this, but note EMU is NOT used everywhere in MS-Office:
https://web.archive.org/web/20141229020130/http://archive.oreilly.com/pub/post/what_is_an_emu.html

Maybe you meant 0.085 mm?
There a 1440 twips in an inch, 1440 Ć· 300 = 4.8 twips per dot
Also, there are 4 colours, so a printer can only place a dot in a space 4 times that wide, 0.3387 mm

So, the way I understand it, these units are extra accurate to prevent errors from accumulating on a long sequence of calculations? How would LibreOffice handle these calculations then?