Bug 46694 - Cannot Wrap Long Formulas Insert->Object->Formula in Writer and Calc
Summary: Cannot Wrap Long Formulas Insert->Object->Formula in Writer and Calc
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All All
: high minor
Assignee: Not Assigned
Keywords: needsDevEval
Depends on:
Blocks: Object
  Show dependency treegraph
Reported: 2012-02-27 13:58 UTC by Charles McCullough
Modified: 2021-09-21 04:53 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:

Container for formula or other type of inserted object (150.57 KB, image/jpeg)
2019-09-21 13:20 UTC, Charles McCullough

Note You need to log in before you can comment on or make changes to this bug.
Description Charles McCullough 2012-02-27 13:58:54 UTC
When using Insert->Object->Formula in Writer or Calc long formulas stretch into the margin and are not printed correctly.  If the formula would wrap with the size of the container, long formulas could be added to documents with less trouble.  The container of the formulas is also rigid and would need to be resizable for this to work.  Decreasing the font size works, but long formulas become unreadable.

I came up with one workaround which was to add the formula to the document and select it there, then copy the formula and paste it into a photo editor (I used Irfanview).  This is a good work around since there are options for adding text, color, and a caption, but it is still a workaround during normal use.

I did not test any of the other components of LO, but I assume the problem would be the same.

Here is a test formula that stretches beyond the margin in Writer:

drarrow E_2=1 over 2 left [ left ( M2 d_2^2 + ZZ1 + ZZ2 + MX2 C2 d_2 - MY2 S2 d_2 right ) dot{q_1}^2 + left ( 2 ZZ2 + MX2 C2 d_2 - MY2 S2 d_2 right ) dot{q_1} dot{q_2} + ZZ2 dot{q_2}^2 right ]
Comment 1 Christopher Yeleighton 2012-02-27 14:18:16 UTC
What kind of a formula is that?
In particular, what does ZZ1 stand for?
Do not use identifiers in formulas, it will make them shorter.
Comment 2 Rob 2012-02-27 15:00:40 UTC
I agree. There should be a few more formatting tools available. This problem would have been resolved if 'newline' or a shift+return worked in there somewhere, allowing the author to break up the formula while allowing her to effectively communicate her idea.
Comment 3 Charles McCullough 2012-02-27 16:45:26 UTC
Formula size can be edited in Calc using Format->Graphic->Position and Size.  However, copying and pasting the resized formula into Writer is ineffective.  The formula appears again at the original size.  Using the Format->Styles and Formatting->Formulas is ineffective in Writer, and the Formatting->Object->Postition and Size is unavailable as a choice for resizing formulas.

All in all I tried adding the "Position and Size" button, the "Text Size" button, and the "Wrap" button to the Formulas toolbar in Writer.  These features either weren't available or offered no help for resizing the formula.  In Writer I couln't find many features available for editing the formula, although colorizing the formula box did work.  Very nice touch.

The ability to resize the formula in Calc is of little value.  Long formulas will still exceed the boundaries of a print margin and making such a formula smaller will inevitably cause the formula to be unreadable.  And if the formula is needed in Writer, even the ability to effectively paste a formula created in Calc would be short changing the user if said was required to use Calc to do so.  The feature is available in Writer, and I for one think it makes sense to improve the interface and functionality.  2 cents I guess.

In my opinion, the best option ultimately for this feature would be to create a non-rigid container for each inserted formula which enables users to "break" a formula into more than one line.  Color can be added to the formula box which is nice.  Otherwise an approach similar to the workaround which uses a picture editing sort of feature could work I suppose.
Comment 4 Joel Madero 2016-02-06 21:11:33 UTC
Just an updated to status:

Tested on:
Bodhi Moksha
LibreOffice & 3.3 (inherited from OOo)

Same behavior on both (updating version to reflect that same behavior existed at the beginning of time)

Updating Hardware to reflect that this is not a Windows only issue.

I wonder if this would be an interesting easy hack - requesting dev evaluation to determine.
Comment 5 Timur 2016-04-05 17:01:07 UTC
I guess this is what attachment 72390 [details] from Bug 64079 suffers also.
Comment 6 Timur 2016-04-05 17:04:23 UTC
And if that's the same, doesn't look like an enhancement at all. As shown, you don't see formula. So I set to minor.
Comment 7 Charles McCullough 2016-08-29 14:18:45 UTC
72390 is the same issue.

As a reference, open attachment 72390 [details] in MS Word 2007.  You will clearly how MS chose to handle the problem.  I like the interaction there, but I do think it would be impressive to easily be able to resize the box and make it narrower or wider (and also the formula text size).  Don't see how (if it indeed is) that's easily achieved in Word 2007.
Comment 8 QA Administrators 2017-09-01 11:20:05 UTC Comment hidden (obsolete)
Comment 9 Thomas Lendo 2018-09-20 07:39:56 UTC
Still reproducible.

Version: (x64)
Build ID: 18c5089df091bddeb8c2dc339776671964389040
CPU threads: 8; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-09-12_23:24:12
Locale: de-AT (de_AT); Calc: CL
Comment 10 QA Administrators 2019-09-21 03:07:27 UTC Comment hidden (obsolete)
Comment 11 Charles McCullough 2019-09-21 13:20:43 UTC
Created attachment 154342 [details]
Container for formula or other type of inserted object

For times when the box/text container go beyond the canvas, Paint simply makes any portion of the text outside the canvas invisible.  It won't show up in a print, and once the box is closed the text cannot be altered.

LO formula/object container could handle print the same way for portions of a container which are outside of the margin.  However, I feel this container would be better as permanent object in a document with its own properties rather than the temporary object which deposits its contents as seen in Paint.  Perhaps the LO container could be anchorable so that it's size/position are fixed in the document.
Comment 12 QA Administrators 2021-09-21 04:53:07 UTC
Dear Charles McCullough,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)

If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword

Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team