## [Solved] Formatting when aligning equations at the =

Discuss the formula editor

### [Solved] Formatting when aligning equations at the =

As you can see from the attached image, the numerator and denominator are shifted to the left of the fraction bars. Is there any way to fix this?

Code: Select all   Expand viewCollapse view
`size 28 nospace { matrix{ alignr nospace{int f(x)dx} # {}={} # alignl nospace{ 2 x^2 + 3 x - 1 } over {x^{1/3}}dx ## alignr {} # {}={} # alignl int left({ nospace{2 x^2} over {x^{1/3}} } + { nospace{3 x} over {x^{1/3}} } - { {1} over {x^{1/3}} }right)dx ## alignr {} # {}={} # alignl int (nospace{2 x^{5/3} + 3 x^{2/3} - x^{1/3}})dx ## alignr {} # {}={} # alignl 2 cdot { {3} over {8} } x^{8/3} + 3 cdot { {3} over {5} } x^{5/3} - 3 cdot { {3} over {2} } x^{2/3} + C ## alignr {} # {}={} # alignl { {3} over {4} } x^{8/3} + { {9} over {5} } x^{5/3} - { {3} over {2} } x^{2/3} + C} }`
Last edited by robleyd on Sat Aug 01, 2020 8:17 am, edited 2 times in total.
Reason: Tagged ✓ [Solved] (see topic 102648); add green tick
OpenOffice 4.1.5 on Windows 10
22878

Posts: 20
Joined: Tue Jul 07, 2020 1:02 am

### Re: Issue with formatting when aligning equations at the =

Your formula code applied in my LibreOffice 6.2.8:

Tibor Kovacs, Hungary; LO6.1.6, 6.2.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.4.5;AOO4.1.7
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.

Zizi64
Volunteer

Posts: 9602
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

### Re: Issue with formatting when aligning equations at the =

Zizi64 wrote:Your formula code applied in my LibreOffice 6.2.8:

Formula in LO.png

Do you see how the numerators and denominators in the fractions are shifted to the left side of the fraction bar instead of being centered? That's what I'm trying to fix.
OpenOffice 4.1.5 on Windows 10
22878

Posts: 20
Joined: Tue Jul 07, 2020 1:02 am

### Re: Issue with formatting when aligning equations at the =

Do you see how the numerators and denominators in the fractions are shifted to the left side of the fraction bar instead of being centered? That's what I'm trying to fix.

Ahhh... I meant the integral signs in your image above.
Tibor Kovacs, Hungary; LO6.1.6, 6.2.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.4.5;AOO4.1.7
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.

Zizi64
Volunteer

Posts: 9602
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

### Re: Issue with formatting when aligning equations at the =

The modified first line seems to work as you expected (I put an "alignc" command into the denominator):

Code: Select all   Expand viewCollapse view
`alignr nospace{int f(x)dx} # {}={} # alignl nospace{ 2 x^2 + 3 x - 1 } over {alignc {x^{1/3}}}dx ##`
Tibor Kovacs, Hungary; LO6.1.6, 6.2.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.4.5;AOO4.1.7
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.

Zizi64
Volunteer

Posts: 9602
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

### Re: Issue with formatting when aligning equations at the =

As formatted with OpenOffice 4.1.7 on Mac OS 10.14.6
Use Format → Alignment → Centered then
`size 28 {   int f(x)dx    stack { ~=~ int {                  {2 x^2 + 3 x - 1} over {x^{1/3}}                } dx ~~~~~~~~~~~         # ~=~ int { left (                      { {2 x^2} over {x^{1/3}} } +                      { {3 x}   over {x^{1/3}} } -                     { 1       over {x^{1/3}} }               right ) } dx ~~~~~~         # ~=~ int {                   {2 x^{5/3} + 3 x^{2/3} - x^-{1/3}}               } dx ~~~~~         # ~=~ 2 cdot { 3 over 8 } x^{8/3} +                3 cdot { 3 over 5 } x^{5/3} -                       { 3 over 2 } x^{2/3} + C         # ~=~ { 3 over 4 } x^{8/3} +               { 9 over 5 } x^{5/3} -               { 3 over 2 } x^{2/3} + C ~~~~         } }`
It's more important to get the math right than spend hours fussing over tiny formatting details.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800 on MacOS 10.14.6.   The locale for any menus or Calc formulas in my posts is English (USA).

MrProgrammer
Moderator

Posts: 3945
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

### Re: Issue with formatting when aligning equations at the =

MrProgrammer wrote:
Screen Shot 2020-07-18 at 14.15.47.png
Use Format → Alignment → Centered then
`size 28 {   int f(x)dx    stack { ~=~ int {                  {2 x^2 + 3 x - 1} over {x^{1/3}}                } dx ~~~~~~~~~~~         # ~=~ int { left (                      { {2 x^2} over {x^{1/3}} } +                      { {3 x}   over {x^{1/3}} } -                     { 1       over {x^{1/3}} }               right ) } dx ~~~~~~         # ~=~ int {                   {2 x^{5/3} + 3 x^{2/3} - x^-{1/3}}               } dx ~~~~~         # ~=~ 2 cdot { 3 over 8 } x^{8/3} +                3 cdot { 3 over 5 } x^{5/3} -                       { 3 over 2 } x^{2/3} + C         # ~=~ { 3 over 4 } x^{8/3} +               { 9 over 5 } x^{5/3} -               { 3 over 2 } x^{2/3} + C ~~~~         } }`
It's more important to get the math right than spend hours fussing over tiny formatting details.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.

I am using format > alignment > centered, and your code doesn't line everything up, but it does make it so the numerators and denominators aren't shifted to the left. What are these ~? It seems you are just adding spaces to line things up? Also, I know there were mistakes in my first post, I fixed them in my image before you responded.

Note: I used the formatting recommended here: https://wiki.openoffice.org/w/images/3/ ... ide3.3.pdf to align the equations at the equals sign.
OpenOffice 4.1.5 on Windows 10
22878

Posts: 20
Joined: Tue Jul 07, 2020 1:02 am

### Re: Issue with formatting when aligning equations at the =

Does anyone have a solution? I used the method recommended in the Math guide. I cannot understand why everything is shifted to the left.
OpenOffice 4.1.5 on Windows 10
22878

Posts: 20
Joined: Tue Jul 07, 2020 1:02 am

### Re: Issue with formatting when aligning equations at the =

I cannot understand why everything is shifted to the left.

Because you have used the alignl (= align left) command inside the formula. Use the alignc (= align ceter) command for the relevant parts of the formula, as I pointed it above. Use the braces for the parts of the formla what you want to align center.
Tibor Kovacs, Hungary; LO6.1.6, 6.2.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.4.5;AOO4.1.7
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.

Zizi64
Volunteer

Posts: 9602
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

### Re: Issue with formatting when aligning equations at the =

22878 wrote:I cannot understand why everything is shifted to the left.
You requested left alignment for your fraction with:
`alignl nospace{ 2 x^2 + 3 x - 1 } over {x^{1/3}}dx`

22878 wrote:Does anyone have a solution?
I gave you a solution and included a picture of the formatted equation on my system. You seemed to be dissatisfied with the result on your system, but did not give any precise indication of why. "Your code doesn't line everything up" is too vague. To receive any further assistance from me, you must provide more information. It will be helpful if you attach a screen image (as a picture), the exact Math syntax you used (as text and not a picture), and what adjustment you want to make.

There are known, and solved, Math font formatting problems on awful Windows so perhaps you have a problem at the operating system level. Have you fixed the problem from that link? I, thankfully, run MacOS instead of odious Windows, so if your code formats correctly on my system, I may not be of much help to you.

I will probably decline to help with adjusting tiny formatting details which would be a waste of my freely-offered time. However, If you choose to focus on that, go right ahead, and perhaps others will have suggestions for you.

22878 wrote:What are these ~?
Math Guide
Documentation/Reference/Math commands
Mr. Programmer
AOO 4.1.7 Build 9800 on MacOS 10.14.6.   The locale for any menus or Calc formulas in my posts is English (USA).

MrProgrammer
Moderator

Posts: 3945
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

### Re: [Solved] Formatting when aligning equations at the =

Was my last reply deleted? I swear I responded and now it's not showing up.
OpenOffice 4.1.5 on Windows 10
22878

Posts: 20
Joined: Tue Jul 07, 2020 1:02 am

### Re: [Solved] Formatting when aligning equations at the =

22878 wrote:As you can see from the attached image, the numerator and denominator are shifted to the left of the fraction bars.
22878 wrote:Was my last reply deleted? I swear I responded and now it's not showing up.
This topic has concerned centering in formulas. You asked about a new subject, vertical alignment, so a new topic was created for you: Match vertical alignment in multi-line formula.

We prefer to keep to one subject per topic. Subjects are not considered related simply because they are from the same person. You'll find replies to the new subject there. View your posts is a simple way to find your posts, even if they have been split to a new topic. Most recent posts will be at the top.
Mr. Programmer
AOO 4.1.7 Build 9800 on MacOS 10.14.6.   The locale for any menus or Calc formulas in my posts is English (USA).

MrProgrammer
Moderator

Posts: 3945
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

### Re: [Solved] Formatting when aligning equations at the =

Zizi64 wrote:
But is there a way to align the left side to the top instead of in the middle as you can see in your screencap?

Your original formula works for me, when I modified it by the usage the "alignc" command in proper bracing.

This is amazing. This is the correct solution to my problem, because it uses the method recommended to line up equations at the equals sign, so you don't have to use the space hacks, which don't completely line up the equals signs, like this does, plus you need another stack or something to get the left half of the equation at the top with the other method. Bravo, Tibor.
Attachments
Formula.odt