Bug 159600 - Extra curly braces {} added to equations and element in the wrong position when adding elements in a Math formula in Writer
Summary: Extra curly braces {} added to equations and element in the wrong position wh...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
24.2.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 159949 (view as bug list)
Depends on:
Blocks: Formula-Editor Visual-Mode-of-Formula-Editor
  Show dependency treegraph
 
Reported: 2024-02-06 15:05 UTC by Chris Kirkland
Modified: 2024-03-11 13:31 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Writer file showing result of the Math formula bug (18.71 KB, application/vnd.oasis.opendocument.text)
2024-02-06 15:07 UTC, Chris Kirkland
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Kirkland 2024-02-06 15:05:52 UTC
Description:
On entering a symbol from the Elements sidebar in Math, the formula has lots of curly braces {} added to  it. The element does not add in the expected position at the cursor.
This occurs in versions 24.2.0.2 and 24.2.0.3 but not 7.6.4.1

Steps to Reproduce:
1. Open a new writer document
2. Insert (menu) 
3. OLE object > Formula Object
4. Type: x space y space ~=~ space a space
5. All OK so far.
6. From the Elements sidebar select Unary/Binary operators click on Tensor product.
7. The position of the Tensor product is not in the place expected, after the a.
There are a lot of curly braces added around parts in the equation.
This is an example but the problem is more general with curly braces being added around lots of parts of the equation.


Actual Results:
Element is added at the beginning of the formula and several sets of curly braces {} are added around the formula.

Expected Results:
Element is added at the end of the formula at the position of the cursor. Curly braces not added.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
I have checked this with a clean download of 24.2.0.2 with an the default profile. This occurs regularly with other attempts at producing different formulas.
Comment 1 Chris Kirkland 2024-02-06 15:07:51 UTC
Created attachment 192433 [details]
Writer file showing result of the Math formula bug
Comment 2 V Stuart Foote 2024-02-06 15:35:53 UTC
In the release notes, at 24.2 the Math Formula Editor is now in Visual mode. Meaning the formula cursor rather than the edit bar has focus. Look there for cursor position and placement of inserted elements.

The additional braces result both from use of the spacing "~" marks, and more general need to protect the formula layout given the shift to Visual in-line edit mode, see also bug 130741

If you want to restore the old 7.6 (non-visual mode) open the Math module directly and from Tools -> Options -> LibreOffice Math 'Settings' panel uncheck the 'Enable visual editing' and OK out. Might note the other settings as well.

We are interested in any legitimate issues with the shift of the formula editor to the visual edit mode.
Comment 3 Chris Kirkland 2024-02-06 16:04:24 UTC
(In reply to V Stuart Foote from comment #2)
> In the release notes, at 24.2 the Math Formula Editor is now in Visual mode.
> Meaning the formula cursor rather than the edit bar has focus. Look there
> for cursor position and placement of inserted elements.
> 
> The additional braces result both from use of the spacing "~" marks, and
> more general need to protect the formula layout given the shift to Visual
> in-line edit mode, see also bug 130741
> 
> If you want to restore the old 7.6 (non-visual mode) open the Math module
> directly and from Tools -> Options -> LibreOffice Math 'Settings' panel
> uncheck the 'Enable visual editing' and OK out. Might note the other
> settings as well.
> 
> We are interested in any legitimate issues with the shift of the formula
> editor to the visual edit mode.

Thankyou. I missed that change. I am very happy it isn't a bug.
To anyone else: find the LibreOffice Math settings by opening a new Formula from the new document list, not just inserting a formula in Writer. 
Best wishes.
Comment 4 V Stuart Foote 2024-02-29 00:45:43 UTC
*** Bug 159949 has been marked as a duplicate of this bug. ***
Comment 5 Roberto Salomon 2024-02-29 00:47:54 UTC
Thank you can confirm it is working fine on 24.2.1.2
Comment 6 Chris Kirkland 2024-03-01 13:43:43 UTC
I am now using version 24.2.1.2
Creating a formula using Formula as an independant item seems to work fine in both modes.
I am used to adding lots of formulas into documents inserting and editing formulas directly in Writer. Turning off visual editing makes everything work fine using the input area at the bottom of the screen. 
Turning on visual editing makes working with complex formulas difficult, I have to revert to using the input area at least some of the time. I also notice that using visual editing the "newline" element does not get added when used from the elements sidebar.
I would expect Formula to behave the same way when used as an independant item and when used as an insert into Writer.
I am happy continuing to use Formula inserted into Writer with Visual Editing turned off for the time being.
I hope these comments help. 
Thankyou to the team working on Formula, it is the reason I turned to OpenOffice.org and then LibreOffice.
Comment 7 Chris Kirkland 2024-03-11 06:39:50 UTC
(In reply to Roberto Salomon from comment #5)
> Thank you can confirm it is working fine on 24.2.1.2
newline is not working when using Formula as a separate module and in Visual Editing mode. (Windows 11)
Comment 8 V Stuart Foote 2024-03-11 13:31:54 UTC
(In reply to Chris Kirkland from comment #7)
> (In reply to Roberto Salomon from comment #5)
> > Thank you can confirm it is working fine on 24.2.1.2
> newline is not working when using Formula as a separate module and in Visual
> Editing mode. (Windows 11)

Opened as a new issue as bug 160151