Inkscape Community

Help Using Inkscape => Using Inkscape with Other Apps => Topic started by: Ladril on May 29, 2018, 09:36:20 AM

Title: Impossible to render LaTeX formula??
Post by: Ladril on May 29, 2018, 09:36:20 AM
Hello Inkscape community.

I have been using Inkscape to make figures for my research for many years. I upgraded my laptop to the latest stable Ubuntu release (18.04), and now I am unable to render LaTeX formulas with the Render/Latex menu. I get the following error message:

"Unrecoverable error: undefined in DELAYBIND

PostScript/PDF Interpreter finished. Return status 65280 executed command : /usr/bin/gs -q -dDELAYBIND -dWRITESYSTEMDICT -dNODISPLAY -dNOEPS "/tmp/psinr0LGen"

The interpreter seems to have failed, cannot proceed !

Traceback (most recent call last):
  File "eqtexsvg.py", line 160, in <module>
    e.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 283, in affect
    self.effect()
  File "eqtexsvg.py", line 154, in effect
    svg_open(self, svg_file)
  File "eqtexsvg.py", line 81, in svg_open
    doc = inkex.etree.parse(filename)
  File "src/lxml/etree.pyx", line 3426, in lxml.etree.parse
  File "src/lxml/parser.pxi", line 1839, in lxml.etree._parseDocument
  File "src/lxml/parser.pxi", line 1865, in lxml.etree._parseDocumentFromURL
  File "src/lxml/parser.pxi", line 1769, in lxml.etree._parseDocFromFile
  File "src/lxml/parser.pxi", line 1162, in lxml.etree._BaseParser._parseDocFromFile
  File "src/lxml/parser.pxi", line 600, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 710, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 639, in lxml.etree._raiseParseError
  File "/tmp/inkscape-ggwtNw/eq.svg", line 1
lxml.etree.XMLSyntaxError: Document is empty, line 1, column 1"



I know this is due to pstoedit using a deprecated function of ghostscript. However, I am not a very skilled user of Linux, and I'm unable to downgrade ghostscript since the only packages available through apt-get are version 9.22 (I read 9.21 is the latest GS version without that doesn't show this bug).

Did anyone here encounter this problem, and can indicate me how to solve it? Thank you very much in advance!!

Title: Re: Impossible to render LaTeX formula??
Post by: Moini on May 29, 2018, 03:00:45 PM
I haven't upgraded yet.

Can you give a link to some more info, please? I'd like to notify developers of the issue, but I need some info.

Most probably, you should be able to find a compatible .deb package of an older version in the corresponding repositories (e.g. for 17.10). It may break other applications in 18.04, though.

Maybe in this case, installing the snap package or the older flatpak version will be a way to keep on working (even though that has some other drawbacks).
Title: Re: Impossible to render LaTeX formula??
Post by: Ladril on May 29, 2018, 03:09:59 PM
Here's a post in Ask Ubuntu with somebody reporting the same problem:

https://askubuntu.com/questions/1034894/render-latex-is-not-working-in-inkscape-after-installing-to-18-04 (https://askubuntu.com/questions/1034894/render-latex-is-not-working-in-inkscape-after-installing-to-18-04)

Here, somebody with the same problem in MacOS:

http://inkscape.13.x6.nabble.com/LaTeX-rendering-fail-td4981668.html (http://inkscape.13.x6.nabble.com/LaTeX-rendering-fail-td4981668.html)

Here, another similar problem:

https://bugs.launchpad.net/inkscape/+bug/1734624 (https://bugs.launchpad.net/inkscape/+bug/1734624)


The only solution I could read about is downgrading ghostscript, which seems a very bad solution in my opinion...
Title: Re: Impossible to render LaTeX formula??
Post by: Moini on May 29, 2018, 06:01:04 PM
Thank you, I've updated the bug report you linked with more info, and I hope that someone will answer soon. It seems, though, that currently, there's nothing Inkscape can do about it... :-/
Title: Re: Impossible to render LaTeX formula??
Post by: Ladril on May 30, 2018, 12:02:31 PM
Thank you very much!
Title: Re: Impossible to render LaTeX formula??
Post by: Moini on May 30, 2018, 02:17:43 PM
Can you keep an eye on the report, too? I might forget to check if someone reacted. If there is no reaction within 1 or 2 weeks, please open a new report.
Title: Re: Impossible to render LaTeX formula??
Post by: Ladril on May 30, 2018, 02:18:51 PM
Sure thing!
Title: Re: Impossible to render LaTeX formula??
Post by: jcwinkler on June 13, 2018, 04:15:12 AM
The solutions proposed in https://askubuntu.com/questions/1034894/render-latex-is-not-working-in-inkscape-after-installing-to-18-04 do not work.


I propose the following solutions which update ghostscript to version 9.23:

Ubuntu/ Kubuntu/ Xubuntu 18.04
This version of ubuntu is a LTS release. I did not find any pre-built packages for ghostscript 9.23. Hence, you have to compile it yourself. In the following I will give instructions for the "average user" who likes using his system as a productive one and is not skilled in compiling procedure etc.

Note: If you encounter any problems with the new ghostscript version in other applications it is easy to switch back to the old one. Just enter the following command in a terminal:
sudo apt-get install ghostscript --reinstall

Windows
Just download ghostscript 9.23 from https://www.ghostscript.com/download/gsdnld.html (https://www.ghostscript.com/download/gsdnld.html) and install it. You are done.

I tested both variantes and it runs smoothly.

Alternative
If you do not like compiling your own gs version you may try TexText and install it together with pdf2svg : https://github.com/textext/textext (https://github.com/textext/textext)


Title: Re: Impossible to render LaTeX formula??
Post by: brynn on June 13, 2018, 07:06:49 PM
Welcome to the forum!  And thanks for the info, too!

Most of that is over my head, so I can't comment on the details.  But hopefully the bug report will get some attention, too.