Excessive spacing on letters in hat in formula

When I type hat p into LibreOffice Math, it looks great!

But when I use the formula object in LibreOffice Writer with the exact same formula, I get this irritating extra
space: image

Using hat "p" fixes that, but then I lose that nice looking italic math letter font.

I haven’t touched any of the style settings of the formula object either. What’s going on?

What have you done exactly? hat is an operator to attach a circumflex accent-like decoration to a symbol. Consequently there is no space between it and the base symbol. Here is what I get in Math 25.8.3.2: image.

What are your OS name, exact LO version and save format?

If you save other than .odt, the formula language gets converted to the other format and there is a possible risk of error.

I took the liberty to retag your question as math as this seems more a Math issue than Writer.

imagen
Version: 24.8.7.2 (X86_64) / LibreOffice Community
Build ID: 480(Build:2)
CPU threads: 4; OS: Linux 6.4; UI render: default; VCL: gtk3

Now, today, I reopen the document (it was saved as ODT) and the space is still there. But once I re-open the formula object and then close it, the space disappears. I don’t think LibreOffice updated, so it must have to do with reopening the document.

Not sure what caused this in the first place. But it is resolved now.

It might have something to do with this bug, 166264 – LibreOffice Math formula visually wrong after .odf saving

If you can repeat the error, you should probably post a bug report, How to Report Bugs in LibreOffice - The Document Foundation Wiki