Bug 113948 - Misalignment of formula with scaled braces in LibreOffice Writer
Summary: Misalignment of formula with scaled braces in LibreOffice Writer
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
5.4.1.2 release
Hardware: All Windows (All)
: medium trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-20 10:58 UTC by post
Modified: 2017-11-27 11:58 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot comparing the two methods (10.26 KB, image/png)
2017-11-20 20:11 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description post 2017-11-20 10:58:06 UTC
Description:
When using scalable braces on the left side of an equal sign, then the vertical alignment of the equal sign is sometimes wrong.
You can workaround it by adding "phantom binom {}{}" to the formula. Then the equal sign gets vertically centered.

Steps to Reproduce:
1. Create a new formula object in LibreOffice Writer
2. Type "sin left( x `+` %pi over 2 right  ) ~=~ cos( x )" into the formula editor

Actual Results:  
Equal sign is not vertically centered.

Expected Results:
Equal sign should be vertically centered.



Reproducible: Always


User Profile Reset: No



Additional Info:
If you change the formula into "sin left( x `+` %pi over 2 phantom binom {}{} right ) ~=~ cos( x )", the equal sign is placed correctly.
I assume, that there is something wrong with the positioning of the equal sign, if scalable braces are found on the left side of the equal sign?
Locale: de
Module: TextDocument
OS: Windows 10
OS is 64bit: yes


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0
Comment 1 Buovjaga 2017-11-20 20:11:44 UTC
Created attachment 137879 [details]
Screenshot comparing the two methods

In this screenshot, we have the phantom method on the right, with pink bg colour. From what I can see, the vertical alignment of the equal sign matches. Same result on Windows.

You might want to attach an example document where you see the difference.
I anchored the formulas as To character to be able to line them up like that.

Arch Linux 64-bit
Version: 6.0.0.0.alpha1+
Build ID: 121303615054568c204def97872343d2014af4a0
CPU threads: 8; OS: Linux 4.13; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on November 17th 2017
Comment 2 post 2017-11-20 20:43:52 UTC
The screenshot you attached looks exactly like mine one on my computer.
Ok, you're right, the equal sign vertically matches the words "sin" and "cos". But I think, that the whole formula (i.e. the words "sin", "cos" and the equal sign) is not vertically centered in relation to the scalable braces on the left.

You can see that there is no space above the "pi" in the non-phantom-method. In my opinion the words before scalable braces should always be vertically centered in relation to the scalable braces. The phantom-method looks nicer, doesn't it?
Comment 3 Regina Henschel 2017-11-20 21:21:26 UTC
The equal sign is at the correct place. It is in line with the + sign and the fraction bar.

The problem is the figure 2 in the denominator. It is much larger as the italic π. Therefore the scaling bracket, which adapts to the size, extends more down than up.

You can get better looking brackets
 by reducing the size of the figure 2 {size*0.8 2},
 by setting π to upright {nitalic %pi} (as it should be, because it is a number and not a variable)
and/or by increasing the distance between fraction bar and numerator (Format > Spacing > Category Fractions).
Comment 4 Buovjaga 2017-11-22 14:59:05 UTC
Adrian: are you content with Regina's proposal? If yes, we could close this.
Comment 5 post 2017-11-23 10:11:22 UTC
Yes, I'm content with her answer. Thanks.

But I have one last question: Why is a standard "Pi" italic? I think, you can assume "Pi" is in most cases NOT a variable, thus it shouldn't be italic. What do you think?
Comment 6 Buovjaga 2017-11-27 10:52:26 UTC
Ok, let's close.

(In reply to post from comment #5)
> But I have one last question: Why is a standard "Pi" italic? I think, you
> can assume "Pi" is in most cases NOT a variable, thus it shouldn't be
> italic. What do you think?

Takeshi: do you have an idea about this?
Comment 7 Regina Henschel 2017-11-27 11:58:18 UTC
StarMath has currently no special handling for pi. That would be an enhancement request, please use a new issue if you wish that.

There exists a setting in the Advanced part. Search for property GreekCharStyle. The property has the possible values 0, 1 and 2.

0 means: Render the character as defined in the symbol set. That is "not italic" for symbol set Greek and "italic" for symbol set iGreek.

1 means: All symbols form symbol set Greek are rendered in "italic".

2 means: Render uppercase character of symbol set Greek in "not italic" and all lowercase characters in "italic". This is the default setting.

The setting affects the entire symbol set Greek.