Bug 48645

Summary: FORMATTING: alignr, alignl operators distort fraction representation
Product: LibreOffice Reporter: Yakov <Yakov.Litvin.publicly>
Component: Formula EditorAssignee: Not Assigned <libreoffice-bugs>
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium CC: stephane.champeau
Version: 3.6.1.2 release   
Hardware: Other   
OS: All   
Whiteboard: BSA
i915 platform: i915 features:
Attachments: Using the 'align' command inside an equation with fractions

Description Yakov 2012-04-13 05:35:41 UTC
Problem description: 

In systems of equations, it is usually desirable to align all the equations to the left. For instance, for this one:

left lbrace stack{
 {{dot d}_n over{n-2}} = ...
#
 longer expression
}right none

it is desirable to move the first line to the left. However, if one uses alignl "operator", he couldn't get the desirable result, because the fraction {dot d}_n over{n-2} gets distorted.

Steps to reproduce:
1. try

left lbrace stack{
 alignl {{dot d}_n over{n-2}}
#
 alignl ........................................................................
}right none

in this case, dot d_n in the fraction is moved to the left in the numerator which I consider as a bug.

2. To avoid this I tried

left lbrace stack{
 alignl {alignc {dot d}_n over{n-2}}
#
 alignl ........................................................................
}right none

but instead of just making numerator normal, this makes the whole expression aligned to the center.

Current behavior:

already described.

Expected behavior:

alignl, alignr shouldn't change the numerator at all, just never in math expressions numerator is aligned to the left or right, always to the center.

Platform (if different from the browser): 
              
Browser: Opera/9.80 (Windows NT 6.0; U; ru) Presto/2.10.229 Version/11.61
Comment 1 Christina Rossmanith 2012-08-06 19:11:23 UTC
Adding braces around alignc helps:

{{alignc {dot d}_n} over{n-2}}
Comment 2 Roberto 2012-08-11 23:01:53 UTC
Created attachment 65446 [details]
Using the 'align' command inside an equation with fractions
Comment 3 Roberto 2012-08-11 23:12:28 UTC
Dear Christina:

You are right, it works. However, imagine a L.O. Math user who needs to write the reasoning behind the process of finding the solution of an equation that contains fractions. The workaround you suggest will work, but (in my opinion) it's something excessively complicated for such a simple . For example, in order to obtain the equation displayed in the screenshot I attach (EquationwithFractions.png), you must type the following lines:

matrix
{
alignr{2 + x} # "" = "" # alignl{{alignc{1} over {x + 1}} - {alignc{2} over{3-x}} + {alignc{1} over {x-2}}}
##
alignr{2+x} # "" = "" # alignl{"more_fractions"}
}

Despite the fact this is only a basic equation, the code is 'a little bit' hard to type, read, understand, and edit. I think fractions (their numerators and denominators)should be always aligned to the center except, maybe, a very specific command is introduced.
Comment 4 Roberto 2012-08-12 17:42:56 UTC
(In reply to comment #3)
> Dear Christina:
> 
> You are right, it works. However, imagine a L.O. Math user who needs to write
> the reasoning behind the process of finding the solution of an equation that
> contains fractions. The workaround you suggest will work, but (in my opinion)
> it's something excessively complicated for such a simple . For example, in
> order to obtain the equation displayed in the screenshot I attach
> (EquationwithFractions.png), you must type the following lines:
> 
> matrix
> {
> alignr{2 + x} # "" = "" # alignl{{alignc{1} over {x + 1}} - {alignc{2}
> over{3-x}} + {alignc{1} over {x-2}}}
> ##
> alignr{2+x} # "" = "" # alignl{"more_fractions"}
> }
> 
> Despite the fact this is only a basic equation, the code is 'a little bit' hard
> to type, read, understand, and edit. I think fractions (their numerators and
> denominators)should be always aligned to the center except, maybe, a very
> specific command is introduced.

In reply to my own last comment: the attached screenshot I refer above (EquationwithFractions.png) is attachment 65446 [details], in comment written at 2012-08-11 23:01:53 UTC.
Comment 5 Roberto 2012-08-12 18:00:04 UTC
(In reply to comment #1)
> Adding braces around alignc helps:
> 
> {{alignc {dot d}_n} over{n-2}}

Dear Christina:

I tried to reply to you, but I selected the wrong option and 'added a new comment' instead of 'replying'. So, to avoid leading everybody read my reply twice, I simply ask to you to log in into bugzilla and read it. As a LibreOffice user, I'm interested in your opinion.

Kind regards.

Roberto.
Comment 6 Yakov 2012-10-14 09:14:32 UTC
(In reply to comment #1)
> Adding braces around alignc helps:
> 
> {{alignc {dot d}_n} over{n-2}}

Thanks for the reply, the workaround works.

On the other hand, the described behavior is still inconvenient, since normally no one needs to align a numerator in another manner than central, and the workaround requires more symbols => more typing, less readable code, and is not that evident.
Comment 7 Stéphane Champeau 2015-01-04 14:43:46 UTC
Hi
It's a very annoying bug
I hope this will be fixed in the future
Thanks

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.