[Upstream] Math equation editor: "newline" fails after symbols

Bug #281053 reported by JC Cheloven on 2008-10-10
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
LibreOffice
Confirmed
Medium
OpenOffice
In Progress
Unknown
libreoffice (Ubuntu)
Medium
Unassigned
openoffice.org (Ubuntu)
Low
Unassigned

Bug Description

1) lsb_release -rd
Description: Ubuntu 11.10
Release: 11.10

2) apt-cache policy libreoffice-writer
libreoffice-writer:
  Installed: 1:3.4.3-3ubuntu2
  Candidate: 1:3.4.3-3ubuntu2
  Version table:
 *** 1:3.4.3-3ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ oneiric/main i386 Packages
        100 /var/lib/dpkg/status

apt-cache policy libreoffice-math
libreoffice-math:
  Installed: 1:3.4.3-3ubuntu2
  Candidate: 1:3.4.3-3ubuntu2
  Version table:
 *** 1:3.4.3-3ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ oneiric/main i386 Packages
        100 /var/lib/dpkg/status

3) What is expected to happen in LibreOffice Writer via the Terminal:

cd ~/Desktop && wget https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/281053/+attachment/2417117/+files/math_newline_issue.tar.gz && file-roller -h math_newline_issue.tar.gz && cd math_newline_issue && lowriter -nologo math_newline_issue.odt

is no upside down question marks are presented in the Math formulas.

4) What happens is the upside down question marks are present erroneously due to "newline" command. If "newline" is preceded or followed by some characters (as +, -, =, which are often needed), some error marks "¿" are obtained, and perhaps only a single line if displayed (it depends on the character and its relative position to "newline"). Examples :

a+b_ij = newline = c+d # single line; error mark
a+b_ij newline = c+d # two lines; missing "="; error mark
a+b_ij newline + c+d # correct behaviour !! The "+" sign does fine after newline...
a+b_ij + newline c+d # ... but not before: single line, error mark here
a+b_ij = newline c+d # single line, error mark. The "=" sign does bad whether after or before newline

WORKAROUND: {} newline {}

ProblemType: Bug
Architecture: i386
Date: Fri Oct 10 03:31:54 2008
DistroRelease: Ubuntu 8.04
NonfreeKernelModules: nvidia
Package: openoffice.org-core 1:2.4.1-1ubuntu2
PackageArchitecture: i386
ProcEnviron:
 PATH=/usr/lib/openoffice/program:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=es_ES.UTF-8
 SHELL=/bin/bash
SourcePackage: openoffice.org
Uname: Linux 2.6.24-19-rt i686

JC Cheloven (jc-cheloven) wrote :
Chris Cheney (ccheney) on 2008-10-13
Changed in openoffice.org:
importance: Undecided → Low
status: New → Triaged
Chris Cheney (ccheney) on 2008-10-16
Changed in openoffice:
importance: Undecided → Unknown
status: New → Unknown
Changed in openoffice:
status: Unknown → In Progress
Ian Phillips (ianfp) wrote :

This still affects me in OpenOffice 3.3.1 OOO310m19 (Build:9420) on Ubuntu 9.10. Has there been no progress on this in over a year?

Chris Cheney (ccheney) on 2010-05-13
tags: added: hardy

JC Cheloven, this is unreproducible in LibreOffice Math. Does this work for you?

lsb_release -rd
Description: Ubuntu 11.04
Release: 11.04

apt-cache policy libreoffice-math
libreoffice-math:
  Installed: 1:3.3.2-1ubuntu5
  Candidate: 1:3.3.2-1ubuntu5
  Version table:
 *** 1:3.3.2-1ubuntu5 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty-updates/main i386 Packages
        100 /var/lib/dpkg/status
     1:3.3.2-1ubuntu4 0
        500 http://us.archive.ubuntu.com/ubuntu/ natty/main i386 Packages

Changed in libreoffice (Ubuntu):
status: New → Incomplete
Changed in openoffice.org (Ubuntu):
status: Triaged → Won't Fix

[This is an automated message.]
There are no new official OpenOffice.org releases in Ubuntu packaging anymore => Won't Fix

If the problem persists, please mark this bug as "also affects project Libreoffice" or "also affects distribution Libreoffice (Ubuntu)" if that has not happened already.

Please leave references to upstream OpenOffice.org bugs in place to allow cross pollination.

This is still observed in LibreOffice, at least in Ubuntu 11.04. Here my version details:
LibreOffice 3.3.3
OOO330m19 (Build:301)
tag libreoffice-3.3.3.1, Ubuntu package 1:3.3.3-1ubuntu2

There is an obvious (?) woraround for this, consisting in adding {} after (or before) the equal sign, so that the expression "equals to something". For example in this manner:
a+b_ij = {} newline {}= c+d

Perhaps instead of fixing this, it would suffice to clearly say somewhere in the manual that something MUST exist before and after and equal sign or plus sign, etc. And that if one wants to "equal to nothing", it's still necessary to put something, typically {}. Also possible is "".

JC Cheloven, could you please post an example Math or WRiter file that when a newline is added demonstrates this problem?

Changed in df-libreoffice:
status: New → Incomplete
JC Cheloven (jc-cheloven) wrote :

Sure, and thanks for your attention. It's generated with LibreOffice under Ubuntu11.04.
Also enclosed in .pdf format.

As told in the document:
I'd say the expected behaviour would be to allow us inserting a newline at any place, and to allow us starting/ending a line with whatever we want (be it an equal or plus sign...). At most, displaying a warning in some way, but not an error mark in the output. To sum up, being more docile on what the user wants to write.

Cheers
JC

Changed in libreoffice (Ubuntu):
status: Incomplete → New

Created attachment 52281
math_newline_issue.odt

Downstream bug may be found at:
https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/281053

1) lsb_release -rd
Description: Ubuntu 11.10
Release: 11.10

2) apt-cache policy libreoffice-writer
libreoffice-writer:
  Installed: 1:3.4.3-3ubuntu2
  Candidate: 1:3.4.3-3ubuntu2
  Version table:
 *** 1:3.4.3-3ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ oneiric/main i386 Packages
        100 /var/lib/dpkg/status

apt-cache policy libreoffice-math
libreoffice-math:
  Installed: 1:3.4.3-3ubuntu2
  Candidate: 1:3.4.3-3ubuntu2
  Version table:
 *** 1:3.4.3-3ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ oneiric/main i386 Packages
        100 /var/lib/dpkg/status

3) What is expected to happen in LibreOffice Writer via the Terminal:

cd ~/Desktop && wget https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/281053/+attachment/2417117/+files/math_newline_issue.tar.gz && file-roller -h math_newline_issue.tar.gz && cd math_newline_issue && lowriter -nologo math_newline_issue.odt

is no upside down question marks are presented in the Math formulas.

4) What happens is the upside down question marks are present erroneously due to "newline" command. If "newline" is preceded or followed by some characters (as +, -, =, which are often needed), some error marks "¿" are obtained, and perhaps only a single line if displayed (it depends on the character and its relative position to "newline"). Examples :

a+b_ij = newline = c+d # single line; error mark
a+b_ij newline = c+d # two lines; missing "="; error mark
a+b_ij newline + c+d # correct behaviour !! The "+" sign does fine after newline...
a+b_ij + newline c+d # ... but not before: single line, error mark here
a+b_ij = newline c+d # single line, error mark. The "=" sign does bad whether after or before newline

description: updated
Changed in libreoffice (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
summary: - Math equation editor: "newline" fails sometimes
+ Math equation editor: "newline" fails after symbols
Changed in df-libreoffice:
importance: Undecided → Unknown
status: Incomplete → Unknown
summary: - Math equation editor: "newline" fails after symbols
+ [Upstream] Math equation editor: "newline" fails after symbols
Changed in df-libreoffice:
importance: Unknown → Medium
status: Unknown → Confirmed

[This is an automated message.]
This bug was filed before the changes to Bugzilla on 2011-10-16. Thus it
started right out as NEW without ever being explicitly confirmed. The bug is
changed to state NEEDINFO for this reason. To move this bug from NEEDINFO back
to NEW please check if the bug still persists with the 3.5.0 beta1 or beta2 prereleases.
Details on how to test the 3.5.0 beta1 can be found at:
http://wiki.documentfoundation.org/QA/BugHunting_Session_3.5.0.-1

more detail on this bulk operation: http://nabble.documentfoundation.org/RFC-Operation-Spamzilla-tp3607474p3607474.html

Changed in df-libreoffice:
status: Confirmed → Incomplete

Reproducible in:
lsb_release -rd
Description: Ubuntu precise (development branch)
Release: 12.04

apt-cache policy libreoffice-impress
libreoffice-impress:
  Installed: 1:3.5.0~beta2-2ubuntu3
  Candidate: 1:3.5.0~beta2-2ubuntu3
  Version table:
 *** 1:3.5.0~beta2-2ubuntu3 0
        500 http://us.archive.ubuntu.com/ubuntu/ precise/main i386 Packages
        100 /var/lib/dpkg/status

Changed in df-libreoffice:
status: Incomplete → Confirmed

reproduced in 3.6.0 master on Fedora 64 bit
3.4.3 and 3.5.0 beta on Windows XP 32 bit

Math always tries to get a complete expression from a single line[1]. i.e. it needs something standing after "=" or "+" at the same line. So the following formula will work:

a+b_ij = {} newline {} = c+d

I think it is not a bug... Opinions?

[1] Formula parsing code: starmath/source/parse.cxx

Ivan Timofeev, thank you for taking a look at this. Using as a WORKAROUND:
{} newline {}

is acceptable in the all the cases mentioned in the Description. However, this report is about addressing how the use of newline does not have caveats as per the documentation:
http://help.libreoffice.org/Math/Format
http://help.libreoffice.org/Math/Entering_Line_Breaks

So, any of the original of the examples provided in the Description are valid and should work, but not all do.
It would be beneficial for newline be changed to work according to the expectation mentioned in the Description.
As well, having newline's idiosyncrasies documented in the meantime would be nice for others who fall down the same hole.

description: updated

(In reply to comment #5)
> Using as a WORKAROUND:
> {} newline {}
> is acceptable in the all the cases mentioned in the Description.

Not always "{} newline {}". You use {} when you need to provide the missing operand of a binary operator. For example,

a+b_ij newline = c+d # left-hand side is missing at the second line
a+b_ij newline {} = c+d # add {} - OK

a+b_ij = newline c+d # right-hand side is missing at the first line
a+b_ij = {} newline = c+d # add {} - OK

And from my point of view, the requirement - "provide all operands, otherwise there will be the flipped question mark" - is simply awful, it would be a great improvement to get rid of it. newline's behavior will be much more intuitive.

Ivan Timofeev committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f52138deee9e129d0566f06d1d2138b6b159d16a

fdo#41739: Math: do not skip "newline" on error

So - newline works everywhere now. That should reduce the number of confused users. :)

Changed in df-libreoffice:
status: Confirmed → Fix Released

Ivan Timofeev committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5f80687188db3a29fb0c3a5fe587aeeb3e13dccd

Revert "fdo#41739: Math: do not skip "newline" on error"

Sorry, I have reverted the commit, it causes awful hangs. The newline token
needs to be handled in many other places, but I really fear to break the parser
again in a more subtle way.

Changed in df-libreoffice:
status: Fix Released → Confirmed

As this bug is not assigned and there has been no activity by the original patch author for months I'm moving this back to NEW.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.