简体   繁体   中英

Latex rendering not working in Inkscape 0.92.2?

I have used Inkscape and Latex extensively before. However I had to recently reinstall OS and all softwares I need on my computer. It is Linux Mint 18.3 Cinnamon now. I am unable to render simple latex formula in Inkscape 0.92.2. The Ghostscript version I have is 9.18, and Texlive 2017 full installation. The error that I am getting is linked below. I will appreciate any help on this. Thank you! Inkscape_Latex_Error

" Traceback (most recent call last):
  File "eqtexsvg.py", line 160, in <module>
    e.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 285, in affect
    self.output()
  File "/usr/share/inkscape/extensions/inkex.py", line 272, in output
    self.document.write(sys.stdout)
  File "src/lxml/etree.pyx", line 2050, in lxml.etree._ElementTree.write 
  (src/lxml/etree.c:67059)
  File "src/lxml/serializer.pxi", line 731, in lxml.etree._tofilelike 
  (src/lxml/etree.c:141721)
  File "src/lxml/etree.pyx", line 326, in 
  lxml.etree._ExceptionContext._raise_if_stored (src/lxml/etree.c:13244)
  File "src/lxml/serializer.pxi", line 648, in 
  lxml.etree._FilelikeWriter.write (src/lxml/etree.c:140348)
  TypeError: write() argument must be str, not bytes"

Let me give you the solution first that worked for me. I was having the same problem with Inkscape 0.92.2. If you are not very specific about using the latest version of Inkscape then just uninstall 0.92.2 and install version 0.91.7. It will solve your problem. I am using Ubuntu 16.04. In the software center both these versions are available. But initially, I also chose 0.92.2 and started having the same problem. Then I uninstalled it and installed the older version. Latex rendering is working perfectly now. Just one thing, before doing anything else, check whether you have "pstoedit" installed or not. If not, do it first.

I understand why 0.92.2 is not working on Ubuntu 16.04 or for your system. Inskscape uses the python script "eqtexsvg.py" to convert tex equations to svg format. This process obviously require the python script to find the path of latex command. When you install 0.91.7 you will see Inkscape gets installed in /usr/share directory. But 0.92.2 uses /home/user/snap directory. Hence, the .inx part of the extension can neither find latex nor dvips. I think the problem with 0.92.2 can be solved as well just by mentioning the full path of latex and dvips in the .inx file. I was too lazy to do that. Anyway, 0.91.7 is pretty good enough at this moment for me. I may try the other solution later.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM