Cannot edit old SVG formulas with proper Description & Title
Brought to you by:
baudinr
I have an old LibreOffice document which I cannot edit the formulas that were created in it:
Reproduce procedure:
A document example is attached.
I think that it was created with LibreOffice 4 (don't remember the TexMaths version).
Currently I'm using:
Important: The difference between this ticket and the following:
https://sourceforge.net/p/texmaths/bugs/68/
is that this ticket refers to SVG image objects which their Description and Title fields are NOT empty.
Thanks for the bug report and the example. Unfortunately I still can't reproduce the bug. I tried ten times steps 1-3 of your report and each time the equation is opened.
I use the same LO and TexMaths version as you. What system do you use?
Could you try again with a fresh LibreOffice config directory (under Linux, make a backup copy of $HOME/.config/libreoffice and then delete this directory)?
I use Ubuntu 16.04.1.
I tried again with a fresh LibreOffice config directory - I did the following:
You did it the right way.
As I said, I can edit the SVG equation without any problem and it's 100% reproducible on my Ubuntu box.
Perhaps your LO installation is corrupted. You could try to download the latest LibreOffice 5.1.6 from the official site. If you're on Ubuntu, select the deb package archive and install all the deb packages manually. These can coexist with your old 5.1.4 packages without problem. Then run the new version and see if the bug persists.
I installed LO version 5.1.6.2 from:
https://www.libreoffice.org/download/libreoffice-still/
I followed the installation instructions from:
https://wiki.documentfoundation.org/Installing_in_parallel/Linux
including "Step 4 - Optional, but Recommended when Testing: Changing the User Profile location" so that everything will be fresh.
Then I added the TexMaths v0.42 extension that I downloaded 2 days ago, but the problem persists..
Since that I used the shell in order to open that LO, I noticed that when the SVG image is created (By clicking the "LaTeX" button), the following message appear in the shell:
"
** (soffice:5664): WARNING **: Unknown event notification 36
"
Then, I downloaded 5.2.3 from:
https://www.libreoffice.org/download/libreoffice-fresh/
and installed it the same as I did with version 5.1.6.
I re-downloaded TexMaths v0.39 and v0.42.
Then I installed TexMaths v0.39 and everything worked perfectly! Even with SVG! :-)
Then I un-installed TexMaths v0.39 and quitted LibreOffice Writer.
Then I re-opened LO Writer and installed TexMaths v0.42.
Then I quitted LO Writer and then re-opened LO Writer (in order to make the TexMaths extension to load).
Then I tried creating SVG but it failed.. (with the same message etc.).
Then I un-installed TexMaths v0.42 from the "old" LO Writer (version 5.1.4) and then installed TexMaths v0.39 and the SVG worked perfectly!
I just noticed a little problem - when creating a SVG with the string "\Omega hi there", then a small redundant space is added at the end (after "there").
In addition, I noticed in the "old" LO version (5.1.4), with TexMaths v0.42, that if I:
Then I successfully manage to edit it using TexMaths, despite that its "Description" and "Title" fields are empty!
But when I click the "LaTeX" button in order to re-create the SVG image, then a new SVG image is added in adjacent to the old one.
I guess that for now I'll use TexMaths v0.39, because that the png format looks bad when converting the Writer document to a PDF document.
Last edit: Dor 2016-11-06
My system is LinuxMint 18 cinnamon 64bit. I have tried to use LibreOffice 5.2.3 and 5.1.6 which was downloaded from official cite.
I made a screenshot video https://www.youtube.com/watch?v=0sMmhx7Kbhw . So, there are strange things happens.
@Ivan Kulish:
Try installing TexMaths v0.39, it worked well for me with LibreOffice v5.1.4 and v5.2.3.
Last edit: Dor 2016-11-06
Yes, I have done it. 0.39 works without this bug on my video, but it can not recognize expressions which I made in 0.42 version in 5.1.4 LibreOffice.
OK, I'll try the following: in a VirtualBox guest, install a fresh Ubuntu or a fresh Linux Mint distro and then install TexLive and TexMaths and see if the bug occurs.
Perhaps, something on my system is different from yours and this test could be useful to discover it.
Another idea that came to my mind: the bug could be related with the system localization. What language do you use?
Finally, I was able to reproduce the bug! I installed a fresh Ubuntu in a Virtual Machine, and bingo, the bug is there.
So I need now to investigate why my usual system doesn't have the bug, and of course to fix it.
Thanks a lot for your investigations and your help. I'll inform you when I'll come to a solution...
Thanks for your work! May be it will be helpful for you:
when I install LibreOffice not from the official site but from LinuxMint Synaptic (Version: 5.1.4.2) then texmaths 0.42 works! But this version of Libre Office is strange: it uses "old style" API: it looks like an old application. Toolbar also looks strange. See my screenshot of Libre Office which has working Texmaths.
And, by the way, it will be also cool (as for me) if it will be possible to set/change global preamble. For example, in each document I need to add \usepackage{braket} for my purposes. It is annoying doing this each time, so, I unpacked extension file and change TexMathsPrefs.xba in this way:
…
"\usepackage{amsmath}" & chr(10) &
"\usepackage{braket}" & chr(10) &
"\usepackage{amssymb}" & chr(10) &_
…
This is probably because the packages libreoffice-gtk and libreoffice-gnome are not installed. Note that, for some reason, when these packages are missing, TexMaths 0.42 works as expected.
Glad to hear :)
Thank you very much!
Yes, I already planned to implement this feature.
@Roland Baudin:
I've noticed that the bug causes problem while resizing the equation's "box" - sometimes only part of the equation performs the resize while the rest of the equation stays the same.
This causes the equation look bad.
I think that I've found a partial solution to the above new problem that I described and to this ticket's problem:
Go to "TexMathEquations" Module and replace the following line:
oGraphic = oDocCtrl.getSelection().GetByIndex(0)With:
oGraphic = oDocCtrl.getSelection().GetByIndex(0).ParentThis fix solves the "missing" Description and Name fields (with TexMaths v0.42) and actually solves our bug.
The problem is that sometimes the Parent object doesn't have a "Size" property.
I don't know yet how to distiguish when we should choose the Parent object..
Therefore this "fix" sometimes may cause an error.
OK, I've found the problem: it is due to a bad interaction between LibreOffice and the libatk-adaptor library (ATK is the Accessibility ToolKit and is used by some accessibility programs like gnome-orca). Six months ago, I already found a problem with this library and LibreOffice, and I've filled a bug report (see https://bugs.launchpad.net/ubuntu/+source/at-spi2-atk/+bug/1584795) because this library can severely slow down LibreOffice.
Now, I've found this library is also responsible for this bug in TexMaths. So I'll fill another bug report and perhaps also one for the LO team.
Anyway, here is a workaround for the TexMaths 0.42 bug:
sudo apt-get purge libatk-adaptor
and then logout + login. Note the apt-get command is 'purge' and not 'remove'. When the package is removed, it also removes some dependencies, like gnome-orca and some libraries: this is OK.
sudo mv /etc/X11/Xsession.d/90atk-adaptor /etc/X11/Xsession.d/90atk-adaptor.orig
and then logout + login. Note that with this method, a package update could recreate the 90atk-adaptor file and in this case you'll have to rename it again...
Thanks to all those who have spent some time to help me reproducing this issue!
I forgot to mention that I didn't saw the bug because the faulty library is not installed on the systems I use to work and develop.
Great thanks! I installed the good last version of Libre Office (Version: 5.2.3.3) and made "sudo mv /etc/X11/Xsession.d/90atk-adaptor /etc/X11/Xsession.d/90atk-adaptor.orig" command (I use LinuxMint Cinnamon) and TexMaths 0.42 works!
Note for other users of LinuxMint Cinnamon: after I deleted 5.1.4 and installed new version my desctop changed: windows becomes some more ugly, wallpapers dissapears. I install packages from Synaptic: "Cinnamon desktop environment" and "mint-meta-cinnamon" and all became OK after restart. (Texmaths also continue work).
@ Ivan:
In order to support an official fix for the problem, please enter the following link:
https://bugs.launchpad.net/ubuntu/+source/at-spi2-atk/+bug/1641284
and click on the green link "This bug affects 2 people. Does this bug affect you?" that is located under the title.
I approve that this fix works flawlessly with Ubuntu 16.04.
Thank you! :-)
Yes, it works now as expected. However, the same bug also appears in Fedora, but I didn't found a workaround yet (the way the system is packages is very different). Moreover, the SVG rendering is broken on Fedora...
I know that this is a bit old but I just found something else that might be useful. If you create the equation using png image, you don't get this issue (can edit and the description field is filled). I also confirm that the "ctrl+z" trick works (can edit but the description field is empty). LO 5.1.6.2, TexMaths 0.43, Ubuntu 16.04.
The bug has gone in recent Linux distributions (Ubuntu 18.04 and derivatives).
I leave it open for those who still stick on old distributions.
Now I close this rather old issue that does not appear in recent Linux distributions.