Bug 65067 - change defaults to avoid unnecessary horizontal spacing around formulas
Summary: change defaults to avoid unnecessary horizontal spacing around formulas
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0
Keywords:
: 65169 96565 103816 134908 149052 (view as bug list)
Depends on:
Blocks: OLE-Objects
  Show dependency treegraph
 
Reported: 2013-05-28 07:23 UTC by Frederic Parrenin
Modified: 2023-07-18 10:10 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Test Word document (9.98 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-06-17 08:39 UTC, Ruslan Kabatsayev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Parrenin 2013-05-28 07:23:03 UTC
Currently, there are unnecessary horizontal spacings around formulas.
To reproduce, try inserting a simple formula like "B".
These spacings make in-line formulas not well integrated and unpleasant to read.
They should be removed.
Comment 1 Owen Genat (retired) 2013-06-10 07:30:35 UTC
In order for this to be confirmed a clearer description of the problem and example file needs to be provided. "B" is not a formula, it is a variable or symbol or character. Bug #65169 is likely to be a duplicate of this bug, but my comment (#1) there is relevant. Please provide a working example where a multi-character in-line formula cannot be typeset using Unicode text (i.e., requires a Formula frame) AND has uneccessary space within the frame. I am not saying this is not a bug, just that an example would be helpful.
Comment 2 Ruslan Kabatsayev 2013-06-10 07:46:30 UTC
*** Bug 65169 has been marked as a duplicate of this bug. ***
Comment 3 Frederic Parrenin 2013-06-10 13:40:27 UTC
Sometimes it is useful to use the formulas for writing variables because it ensure the same font is used for outline formulas (and you do not need to apply the italic style for the variable).

But sometimes it is necessary to use the formula editor, for example if you want to type the int or sum symbols.
Comment 4 Yury 2013-06-16 06:33:52 UTC
Just set in your doc the 'Formula' /frame style/ with 0.0 values for left and right margins. Better, do this in default template.
Comment 5 Ruslan Kabatsayev 2013-06-16 07:54:06 UTC
(In reply to comment #4)
> Just set in your doc the 'Formula' /frame style/ with 0.0 values for left
> and right margins. Better, do this in default template.

If you mean Formula Style -> Wrap -> Spacing, then this is not enough. Still some spacing is left.
Comment 6 Owen Genat (retired) 2013-06-16 14:20:22 UTC
In reply to comment #3, I can see you point. I don't think the integral symbol is a great example as there is a Unicode equivalent, however a summation in the form "sum from{i=1} to{100} i." would be difficult to elegantly set using text. Does the problem still occur though once there is this amount of text in the frame? It looks OK here. Seems to only occur with very small frames.

I think your comments Ruslan in the duplicate bug #65169 (#c3) about visual Word compatibility are probably a better angle to take. Again though, it would be good to have a Word doc (+screenshot) and equivalent ODT (+screenshot) showing the difference. I admit I probably was not accurate enough in my initial comment here. I'm not against using the equation editor for this type of thing (although it does seem to be an edge case) I was mainly trying to get some better examples and improve the problem description. Anyway I have made my point. Best wishes for getting this fixed.
Comment 7 Ruslan Kabatsayev 2013-06-17 08:39:12 UTC
Created attachment 80936 [details]
Test Word document

Well. Here's how it looks in Word 2007 [1]. And how it's in LibO 4.0 [2].

[1]: http://i0.simplest-image-hosting.net/picture/word.png
[2]: http://i0.simplest-image-hosting.net/picture/libo.png
Comment 8 Yury 2013-06-18 17:48:23 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Just set in your doc the 'Formula' /frame style/ with 0.0 values for left
> > and right margins. Better, do this in default template.
> 
> If you mean Formula Style -> Wrap -> Spacing, then this is not enough. Still
> some spacing is left.

There's that (and your proofpics seem to hint at just that solution), and there's Formula Editor->Spacing->Category->Borders->Left/Right -- additional 2 by 1mm. Is it still not enough?
Comment 9 Ruslan Kabatsayev 2013-06-18 18:54:58 UTC
(In reply to comment #8)
> there's Formula Editor->Spacing->Category->Borders->Left/Right -- additional
> 2 by 1mm. Is it still not enough?

This makes things much better. Still, it's not quite enough:
1. This isn't applied automatically to Word documents so they are rendered differently than they are intended to be.
2. This is still not ideal for use independent of M$ Office, see comparison with LᴬTᴇX rendering [1] to see what I'd like to get (some small space still remains). 3. These spaces are really unnecessary for inline formulas, it'd be better if they were omitted by default. (Are they still needed for displayed formulas?)

[1]: http://i0.simplest-image-hosting.net/picture/delta.png
Comment 10 Yury 2013-06-18 21:01:20 UTC
Word documents as a class (and I guess you mean import/export of those) are affected by bug 45284. There is, like, one instance of LibO in the world (sitting on my disk; patch attached to the ticket :)) not adding 'size 12' and 'size 8' to everything in Word-imported/exported formulas.

Then, LibO Formula Editor (renderer) seems to make too much guessing on what is 'acceptable' w/r to spacings, placings etc. Just off my little list, see bug 65808, bug 65774, bug 65229, bug 65230, bug 62355.

Your delta is inserted as %delta, right (so, comes from OpenSymbol)? Might be renderer's guesswork at work, then.
Comment 11 Ruslan Kabatsayev 2013-06-18 21:08:37 UTC
(In reply to comment #10)
> Your delta is inserted as %delta, right (so, comes from OpenSymbol)? Might
> be renderer's guesswork at work, then.
Funnily, it's not. It appears I have a Unicode 𝛿 char in the formula code.
And when I change it to %delta, your workaround with second place of spacing settings gives almost perfect results.
Comment 12 Yury 2013-06-19 06:54:09 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > Your delta is inserted as %delta, right (so, comes from OpenSymbol)? Might
> > be renderer's guesswork at work, then.
> Funnily, it's not. It appears I have a Unicode 𝛿 char in the formula code.
> And when I change it to %delta, your workaround with second place of spacing
> settings gives almost perfect results.

Well, 'delta' on the left of your proofpic definitely is not out of 'CMU Serif' (that on the right is). Looks 'Times New Roman'-ish. What have you set in the Formula Editor 'Fonts', then?
Comment 13 Ruslan Kabatsayev 2013-06-19 07:10:56 UTC
(In reply to comment #12)
> Well, 'delta' on the left of your proofpic definitely is not out of 'CMU
> Serif' (that on the right is). Looks 'Times New Roman'-ish. What have you
> set in the Formula Editor 'Fonts', then?
Couldn't find correct font for delta to look as in LᴬTᴇX case, so left it at Times New Roman. But is it very important which font is in use?
Comment 14 Yury 2013-06-19 08:01:50 UTC
(In reply to comment #13)
> (In reply to comment #12)
> > Well, 'delta' on the left of your proofpic definitely is not out of 'CMU
> > Serif' (that on the right is). Looks 'Times New Roman'-ish. What have you
> > set in the Formula Editor 'Fonts', then?
> Couldn't find correct font for delta to look as in LᴬTᴇX case, so left it at
> Times New Roman. But is it very important which font is in use?

Of course it is. TeX primarily uses well-regulated set of fonts (which means such horisontal things approaches, kerning etc.). That's what CMU pack is derived from, anyway.

But when you mix two different fonts, created on different assumptions about horizontal layout, you might get not-so-good-looking results. E.g., LibO's OpenSymbol might combine not too well with some font faces etc.
Comment 15 ign_christian 2013-06-25 08:32:27 UTC
Duplicate to Bug 55469 ?
Comment 16 Yury 2013-06-25 17:48:52 UTC
(In reply to comment #15)
> Duplicate to Bug 55469 ?

Nope. The complaint here is about horizontal space.
Comment 17 Mike Kaganski 2013-07-06 13:00:19 UTC
In Bug 66405 (comment No.9), I posted a macro to remove all spacing around all formulas in a document at once. Hope this helps.
Comment 18 Regina Henschel 2013-07-08 12:49:27 UTC
There are two places involved.
(1) frame style "Formula" > tab "Wrap". Set left and right spacing to zero.
(2) In formula edit mode or in a Math document goto Format > Spacing. Select "Borders" from the drop-down list "Category". Set left and right to zero.

To make (1) permanent, change it in your default document template.
To make (2) permanent, click on button "Default" in the above mentioned dialog.

Because the settings exists, one can only make an enhancement request to change the defaults.
Comment 19 Regina Henschel 2015-12-17 19:46:16 UTC
*** Bug 96565 has been marked as a duplicate of this bug. ***
Comment 20 Regina Henschel 2015-12-17 20:01:23 UTC
Further duplicates had been in bug 73598 and bug 46464, which had been erroneously set to worksforme and invalid.
Comment 21 Regina Henschel 2017-12-22 21:54:00 UTC
*** Bug 103816 has been marked as a duplicate of this bug. ***
Comment 22 Xisco Faulí 2018-01-09 11:04:09 UTC
*** Bug 111766 has been marked as a duplicate of this bug. ***
Comment 23 V Stuart Foote 2021-01-11 14:35:42 UTC
*** Bug 134908 has been marked as a duplicate of this bug. ***
Comment 24 Regina Henschel 2022-05-12 15:00:59 UTC
*** Bug 149052 has been marked as a duplicate of this bug. ***
Comment 25 Commit Notification 2022-05-17 11:38:52 UTC
Rafael Lima committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/96de6dee60aaf2f0d332291fa3b0ad7bb8b7127c

tdf#65067 Remove excessive spacing from Formula objects

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 26 Rafael Lima 2022-05-18 02:16:00 UTC
All seems OK now. Inserting a new formula object will not add horizontal spacing.

Tested with:

Version: 7.4.0.0.alpha1+ / LibreOffice Community
Build ID: b2467d6c7af988f8ed4e090ebf9472be6c84fb06
CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: threaded
Comment 27 Timur 2023-07-18 10:10:40 UTC
Related: https://gerrit.libreoffice.org/c/core/+/154252