安装到 18.04 后,Render LaTeX 在 Inkscape 中不起作用

Apu*_*rba 7 package-management apt ghostscript inkscape downgrade

我最近安装了 Ubuntu 18.04(不是升级,全新安装)。在 Ubuntu 18.04 中,Inkscape 中的渲染 LaTeX 功能不起作用。以下是错误输出:

*** WARNING - the DELAYBIND command has been deprecated, and will be

           removed in the next version. For now you can restore

           the behaviour by using -dREALLYDEALYBIND but if you

           require continued use of this command you should contact

           the Ghostscript developers. Commercial customers of

           Artifex should email their support contact, free users

           are encouraged to talk to us on the #ghostscript IRC

           channel on irc.freenode.net.



Unrecoverable error: undefined in DELAYBIND

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

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-Y11679/eq.svg", line 1
lxml.etree.XMLSyntaxError: Document is empty, line 1, column 1
Run Code Online (Sandbox Code Playgroud)

从谷歌搜索中,我发现问题是由ghostscript引起的。该Render>LaTeX扩展实际上调用pstoeditwhich in terns 调用ghostscript使用DELAYBIND标志将其转换LaTeXSVG. 但在较新版本中ghostscript该标志DELAYBIND已被弃用。解决办法是降级ghostscript到9.20以下版本。以下是我尝试降级ghostscript但没有成功的方法。

从 apt 或 aptitute 降级 ghostscript

我尝试ghostrict使用以下命令降级。

sudo aptitude install ghostscript=9.18~dfsg~0-0ubuntu2
Run Code Online (Sandbox Code Playgroud)

或者通过使用

sudo apt install ghostscript=9.18~dfsg~0-0ubuntu2
Run Code Online (Sandbox Code Playgroud)

我得到以下输出

Unable to find a version "9.18~dfsg~0-0ubuntu2" for the package "ghostscript"
Run Code Online (Sandbox Code Playgroud)

或者

E: Version '9.18~dfsg~0-0ubuntu2' for 'ghostscript' was not found
Run Code Online (Sandbox Code Playgroud)

我尝试过一些其他版本,比如 Ghost 脚本的 9.20。没有任何效果。

从 ghostscript 网站安装:

我已经ghostscript从下载了ghostscript website,并使用以下命令安装

sudo ./configure
sudo make
sudo make install
Run Code Online (Sandbox Code Playgroud)

似乎安装完成了,但是如果我正在运行命令

ghostscript  --version
Run Code Online (Sandbox Code Playgroud)

它显示版本为 9.22。

我能找到的所有在线解决方案都指向将ghostscript. 但我不知道如何在 Ubuntu 18.04 中做到这一点。

有什么解决办法吗?

bag*_*ris 5

假设您使用 Latex Inkscape 插件texText,它支持 ghostscript+pstoedit 旁边的 pdf2svg。因此,在 Ubuntu 18.04 的情况下,安装 pdf2svg 可以解决问题

sudo apt install pdf2svg
Run Code Online (Sandbox Code Playgroud)

它在 Ubuntu 18.04、InkScape 0.92 上对我有用。