Menu

#69 Cannot edit old SVG formulas with proper Description & Title

v1.0_(example)
closed-fixed
None
5
2019-05-25
2016-11-05
Dor
No

I have an old LibreOffice document which I cannot edit the formulas that were created in it:

Reproduce procedure:

  1. Click on the equation object using the left mouse button.
  2. Click on the 'Pi' button that says "TexMaths Equations".
  3. An error appears:
    "The selected object is not a TexMaths equation...
    Please unselect it and call the macro again..."

A document example is attached.
I think that it was created with LibreOffice 4 (don't remember the TexMaths version).

Currently I'm using:

  • LibreOffice 5.1.4.2
  • TexMaths 0.42

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.

1 Attachments

Discussion

  • Roland Baudin

    Roland Baudin - 2016-11-05

    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)?

     
  • Dor

    Dor - 2016-11-05

    I use Ubuntu 16.04.1.

    I tried again with a fresh LibreOffice config directory - I did the following:

    1. Renamed the directory "$HOME/.config/libreoffice" to "$HOME/.config/libreoffice_BAKMAN".
    2. Opened the same attached document and noticed that a new LibreOffice config directory was created.
    3. I noticed that the TexMaths extension wasn't installed, so I closed the document and then opened a fresh LibreOffice document via which I installed the TexMaths extension that I downloaded yesterday (version 0.42).
    4. Closed the fresh document and then opened the attached document and repeated the steps described above - the problem persists.
     
  • Roland Baudin

    Roland Baudin - 2016-11-06

    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.

     
  • Dor

    Dor - 2016-11-06

    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:

    1. Create an SVG image (with TexMaths).
    2. Click on that image, delete it using the "DELETE" key.
    3. Then click CTRL+Z in order to revert my change.
    4. Click on that image and click CTRL+F (which is a TexMaths shortcut in order to edit an equation - the same as clicking the 'Pi' symbol).

    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
  • Ivan Kulish

    Ivan Kulish - 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.

     
  • Dor

    Dor - 2016-11-06

    @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
    • Ivan Kulish

      Ivan Kulish - 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.

       
  • Roland Baudin

    Roland Baudin - 2016-11-07

    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.

     
  • Roland Baudin

    Roland Baudin - 2016-11-07

    Another idea that came to my mind: the bug could be related with the system localization. What language do you use?

     
  • Roland Baudin

    Roland Baudin - 2016-11-09

    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...

     
    • Ivan Kulish

      Ivan Kulish - 2016-11-09

      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) &_

       
      • Roland Baudin

        Roland Baudin - 2016-11-11

        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.

         
    • Dor

      Dor - 2016-11-10

      Glad to hear :)
      Thank you very much!

       
  • Roland Baudin

    Roland Baudin - 2016-11-10

    Yes, I already planned to implement this feature.

     
  • Dor

    Dor - 2016-11-11

    @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).Parent

    This 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.

     
  • Roland Baudin

    Roland Baudin - 2016-11-11

    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:

    1. If you are on Ubuntu and derivatives (Xubuntu, Gubuntu, Kubuntu...), just remove the package libatk-adaptor, like this:

    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.

    1. If you are on Linux Mint, the above method breaks out the Cinnamon desktop, so don't use it! Instead, do the following:

    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!

     
    • Roland Baudin

      Roland Baudin - 2016-11-11

      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.

       
    • Ivan Kulish

      Ivan Kulish - 2016-11-12

      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).

       
      • Dor

        Dor - 2016-12-03

        @ 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.

         
    • Dor

      Dor - 2016-12-03

      I approve that this fix works flawlessly with Ubuntu 16.04.
      Thank you! :-)

       
  • Roland Baudin

    Roland Baudin - 2016-11-13

    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...

     
  • Hugo Fernando Maia Milan

    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.

     
  • Roland Baudin

    Roland Baudin - 2018-05-08

    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.

     
  • Roland Baudin

    Roland Baudin - 2019-05-25
    • status: open --> closed-fixed
     
  • Roland Baudin

    Roland Baudin - 2019-05-25

    Now I close this rather old issue that does not appear in recent Linux distributions.

     

Log in to post a comment.

Monday.com Logo