seebk / latextext Goto Github PK
View Code? Open in Web Editor NEWInkscape extension to render text as Latex
License: GNU General Public License v3.0
Inkscape extension to render text as Latex
License: GNU General Public License v3.0
Hi,
unfortunately, I see the following error when trying to render the tex input:
*** 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/psinB4DjX4"
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 3444, in lxml.etree.parse (src/lxml/etree.c:83188)
File "src/lxml/parser.pxi", line 1834, in lxml.etree._parseDocument (src/lxml/etree.c:120760)
File "src/lxml/parser.pxi", line 1860, in lxml.etree._parseDocumentFromURL (src/lxml/etree.c:121107)
File "src/lxml/parser.pxi", line 1764, in lxml.etree._parseDocFromFile (src/lxml/etree.c:120015)
File "src/lxml/parser.pxi", line 1161, in lxml.etree._BaseParser._parseDocFromFile (src/lxml/etree.c:114564)
File "src/lxml/parser.pxi", line 598, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/etree.c:107741)
File "src/lxml/parser.pxi", line 709, in lxml.etree._handleParseResult (src/lxml/etree.c:109450)
File "src/lxml/parser.pxi", line 638, in lxml.etree._raiseParseError (src/lxml/etree.c:108304)
File "/tmp/inkscape-eR0BaG/eq.svg", line 1
lxml.etree.XMLSyntaxError: Document is empty, line 1, column 1
I'm on manjaro linux, and all packages are updated to their most recent version. Do we need DELAYBIND
in the gs
call?
Inkscape 0.92.5 (2060ec1f9f, 2020-04-08)
Ubuntu Noetic
Command "pdflatex /tmp/tmp77PlQG/tmp.tex -interaction=nonstopmode -halt-on-error" > failed: [Errno 2] No such file or directory
Traceback (most recent call last):
File "latextext_gtk3.py", line 158, in on_btnApply_clicked
self.run_callback()
File "/home/mirko/.config/inkscape/extensions/latextext.py", line 475, in run
rendergroup = lat2svg.render(latex_string, self.options.preamble, self.options.packages, self.options.fontsize, self.options.scale)
File "/home/mirko/.config/inkscape/extensions/latextext.py", line 580, in render
raise RuntimeError()
RuntimeError
Trying to render LaTeX in a .svg using this Extension with "Extensions>Render>Text with Latex (GTK3)" opens a new window stating:
Inkscape has received additional data from the script executed. The script did not return an error, but this may indicate the results will not be as expected.
ImportError: No module named site
No Layer for the rendered LaTeX is being created.
I am on a Windows 10 environment and installed this extension using the .exe installer.
Dependencies:
Inkscape 0.92.4
MiKTeX 2.9.7050 64-bit
My distribution is not Mikitex, is TexLive, how to configure with this?
Thanks
With the release of the Inkscape 1.0 beta I wanted to start a discussion on what would be required for making this extension work with the new standalone OS X application. Also, are there fundamental changes introduced in 1.0 that require updates to this extension? I'm guessing yes?
So far, the 1.0 experience on OS X seems to be very smooth. It would be great to have this extremely useful extension available as well.
Hi,
Since Python 2 is now officially dead, are there any plans to port this code to Python 3?
Edit: Looks like the answer is "yes", from PR #27
Attempting to solve some problems with installing on Linux x86_64 debian (Mint).
Python3**
(which is current, and so it seems that this Extension is not up to date)install.sh
file, changing "python" to "python3"latextext.py
program:/home/username/.config/inkscape/extensions/LaTeXText-master/extension/latextext.py:472: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if self.options.math and latex_string[0] is not '$':
/home/username/.config/inkscape/extensions/LaTeXText-master/extension/latextext.py:639: DeprecationWarning: Effect.OptionParser or `optparse` has been deprecated and replaced with `argparser`. You must change `self.OptionParser.add_option` to `self.arg_parser.add_argument`; the arguments are similar.
add_options(self.OptionParser)
/home/username/.config/inkscape/extensions/LaTeXText-master/extension/latextext.py:640: DeprecationWarning: Effect.OptionParser or `optparse` has been deprecated and replaced with `argparser`. You must change `self.OptionParser.add_option` to `self.arg_parser.add_argument`; the arguments are similar.
self.OptionParser.set_conflict_handler("resolve")
Traceback (most recent call last):
File "/home/username/.config/inkscape/extensions/LaTeXText-master/extension/latextext_gtk3.py", line 176, in <module>
effect = RenderLatexEffectGTK3()
File "/home/username/.config/inkscape/extensions/LaTeXText-master/extension/latextext.py", line 640, in __init__
self.OptionParser.set_conflict_handler("resolve")
AttributeError: 'RenderLatexEffectGTK3' object has no attribute 'set_conflict_handler'
I was able to fix some of these errors, but other persist (due to my poor python3 skills, I guess)
Instead of rendering all the text in the document, I think it would be more useful if this extension rendered all the text found in a specified layer.
the installer is identified as win64.exe, are there any plans for a win32.exe version?
I just upgraded to windows 10 and after reinstalling MikTex 2.9, Inkspace 0.92.4 and LaTeXText I'm unable to compile Latex script in Inkscape. After I click Apply on the LaTeXText window the following error window opens up and no new layer is created:
Inkscape has received additional data from the script executed. The script did not return an error, but this may indicate the results will not be as expected.
This is the log from LaTeXText :
Command "pdflatex c:\users\joseph\appdata\local\temp\tmpuwy7zf\tmp.tex -interaction=nonstopmode -halt-on-error" failed (code 1):
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 2.9.7300 64-bit)
entering extended mode
(c:/Users/Joseph/AppData/Local/Temp/tmpuwy7zf/tmp.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06>
("C:\Users\Joseph\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\article.cls"
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
("C:\Users\Joseph\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\size10.clo")
)
Sorry, but pdflatex did not succeed.
The log file hopefully contains the information to get MiKTeX going again:
C:\Users\Joseph\AppData\Local\MiKTeX\2.9\miktex\log\pdflatex.log
Traceback (most recent call last):
File "latextext_gtk3.py", line 158, in on_btnApply_clicked
self.run_callback()
File "latextext.py", line 475, in run
rendergroup = lat2svg.render(latex_string, self.options.preamble, self.options.packages, self.options.fontsize, self.options.scale)
File "latextext.py", line 580, in render
raise RuntimeError()
RuntimeError
The pdflatex log reads:
2020-03-19 13:38:28,453-0600 INFO pdflatex - starting with command line: pdflatex c:\users\joseph\appdata\local\temp\tmpuwy7zf\tmp.tex -interaction=nonstopmode -halt-on-error
2020-03-19 13:38:28,469-0600 INFO pdflatex - allowing known shell commands
2020-03-19 13:38:28,469-0600 INFO pdflatex - enabling input (output) from (to) processes
2020-03-19 13:38:28,640-0600 FATAL pdflatex - GUI framework cannot be initialized.
2020-03-19 13:38:28,640-0600 FATAL pdflatex - Info:
2020-03-19 13:38:28,640-0600 FATAL pdflatex - Source: Libraries\MiKTeX\UI\Qt\mikuiqt.cpp
2020-03-19 13:38:28,640-0600 FATAL pdflatex - Line: 77
2020-03-19 13:38:28,640-0600 INFO pdflatex - finishing with exit code 1
Is this really a problem with MiKTeX? MiKTeX is working fine with Texmaker. Also I'm running the same versions of all of these programs on my laptop with windows 10 and don't have this problem. Any help would be much appreciated.
Thanks,
Joseph
LaTexText worked fine just yesterday. It still does in the files I used it on yesterday.
Should I create a new drawing though and try to run it with the same settings as in the other files it does create a new layer but no text and I get the error message below. I also noticed, that should I copy paste an already Latex-transformed text object in my new drawing, it works perfectly fine again, with the settings presented down below that is. But would I change the font size for example, it again doesnt work.
Command "pdflatex c:\users\user\appdata\local\temp\tmp5efh7e\tmp.tex -interaction=nonstopmode -halt-on-error" failed (code 1):
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (MiKTeX 2.9 64-bit)
entering extended mode
(c:/users/user/appdata/local/temp/tmp5efh7e/tmp.tex
LaTeX2e <2015/01/01> patch level 2
Babel <3.9m> and hyphenation patterns for 69 languages loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
("C:\Program Files\MiKTeX 2.9\tex\latex\geometry\geometry.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\graphics\keyval.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\oberdiek\ifvtex.sty")
("C:\Program Files\MiKTeX 2.9\tex\generic\ifxetex\ifxetex.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\geometry\geometry.cfg"))
("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsmath.sty"
For additional information on amsmath, use the `?' option.
("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amstext.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsgen.sty"))
("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsbsy.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\amsmath\amsopn.sty"))
("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\amssymb.sty"
("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\amsfonts.sty"))
No file tmp.aux.
geometry driver: auto-detecting
geometry detected driver: pdftex
("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\umsa.fd")
("C:\Program Files\MiKTeX 2.9\tex\latex\amsfonts\umsb.fd")
! Missing $ inserted.
$
l.13
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on tmp.log.
Traceback (most recent call last):
File "latextext_gtk3.py", line 158, in on_btnApply_clicked
self.run_callback()
File "latextext.py", line 475, in run
rendergroup = lat2svg.render(latex_string, self.options.preamble, self.options.packages, self.options.fontsize, self.options.scale)
File "latextext.py", line 580, in render
raise RuntimeError()
RuntimeError
Installed Inkscape 0.92.4 and MiKTeX 2.9
I am working on a PC without admin rights. Therefore, I have to limit the use to portable version of Inkscape (at least zipped version). Now the issue is how to install this extension manually without admin rights. I tried to extract individual files yet there is an issue:
"Traceback (most recent call last):
File "latextext_gtk3.py", line 6, in
import gi
ImportError: No module named gi"
Is there any possibility to overcome this issue without admin rights?
When I try to run the extension the text is not rendered, but the new 'Rendered Latex' Layer is created. It does not matter if I use 'Text with LaTeX (GTK3)' or 'Text with LaTeX'.
My Installation:
What I did:
Since there is no error message I am not sure if there is a bug or if I just set something up the wrong way. If you need any more information just let me know.
Is it possible to group the resulting LaTeX equation? It is super inconvenient with separate symbols. For example, with rendering
Thanks for building this package, excited to get it working.
I am having an issue when I attempt to render the LaTeX layer:
Additionally, trying to use the other rendering option (Text with Latex) gives me a different error:
"Traceback (most recent call last):
File "latextext.py", line 13, in
from lxml import etree
ImportError: No module named lxml"
My MikTeX package and Inkscape are all up to date.
tabs in lines 439-330
Hello,
I would like to comment that the Inkscape extension TexText is still alive and actively developed:
https://bitbucket.org/pitgarbe/textext
It would be nice if this can be noted in the readme. Since the approaches and goals (editing of one node in TexText and a bunch of nodes in LaTeXText) are different to some extend we do not competete.
Currently the 0.7 release is pending as a pull request (see https://bitbucket.org/jcwinkler/textext for a preview).
Anyway, maybe we can bundle our efforts? We are still using pstoedit and need to move to pdf2svg or even better command line Inkscape. I am just figuring out how to achive this seamlessly.
There is also the extension WriteText which is quite similar to TexText.
Thank you and regards.
Hi, I'm Carlo from Italy. I'm a teacher.
I try to execute the LaTexText addon but Inkscape's dialog window reports an error:
Command "pdflatex c:\users\carlo\appdata\local\temp\tmpz5j9o5\tmp.tex -interaction=nonstopmode -halt-on-error" > failed: [Error 2] Impossibile trovare il file specificato
Traceback (most recent call last):
File "latextext_gtk3.py", line 150, in on_btnApply_clicked
self.run_callback()
File "latextext.py", line 465, in run
rendergroup = lat2svg.render(latex_string, self.options.preamble, self.options.fontsize, self.options.scale)
File "latextext.py", line 569, in render
raise RuntimeError()
RuntimeError
Impossibile trovare il file specificato -> The specified file could not be found
I use Inkscape 0.9.3 and I've installed LaTexText with LaTexText-0.1.1_win64.exe file
My o.s. is win10 64bit. The 4 files are located correctly (C:\Program Files\Inkscape\share\extensions).
Do you have any suggestions for me?
Hi,
I can't get this extension to work in Tumbleweed, probably due to a missing package. But the naming scheme is quite different so I have no clue which package to install.
I have run the install.sh, my extension folder contains latextext_gtk3.inx, latextext_gtk3.py, latextext.py and latextext.pyc.
The extension appears in Inkscape but when I try to run it, a small windows opens and closes immediately afterwards.
I have installed the latest texlive distrubtion. Also I'm sure to have installed pdf2svg, python and python2-lxml and a whole bunch of other "python" and python3 packages. python-gi I'm not sure about, I can't find it in my package manager.
Thanks for your help.
/EDIT
I miraculously found the package in OpenSuse, it's called python2-gobject-Gdk.
It seems to be working now, however I get this warning upon running the rendering process, are these troublesome?:
(latextext_gtk3.py:16918): Gtk-WARNING **: 22:41:12.317: Theme parsing error: gtk.css:68:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version
(latextext_gtk3.py:16918): Gtk-WARNING **: 22:41:12.317: Theme parsing error: gtk.css:69:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version
(latextext_gtk3.py:16918): Gtk-WARNING **: 22:41:12.317: Theme parsing error: gtk.css:73:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version
Try as I might, I cannot get MikTeX to work on my system anymore. I use TexLive now. The LaTeXText extension is great. Is there any way I can point InkScape to pdfLatex in my TexLive install? Thanks in advance.
Hi,
I get the following error message when I try to use the \text command inside math mode. The extension works otherwise:
Message:
Command "pdflatex c:\users\motion~1\appdata\local\temp\tmplpg5_z\tmp.tex -interaction=nonstopmode -halt-on-error" failed (code 1):
Also Inkscape crashes when I use "Text with Latex (GTK3)" instead of using "Text with Latex " only.
I am using Windows 10 and Inkscape 0.92.2 togeher with MikTex.
Hi,
I try to add the extension to inkscape 1.2 and run the installer, however, it is not shown in the list of extensions -> Render. Moreover, the folder C:\Program Files\Inkscape\lib\gtk-3.0\3.0.0\immodules is empty. How can I fix it?
Yours,
Valeria
This is not an issue. I just wanted to thank you for the wonderful library (and for a setup file which works on windows)! I remember struggling to install it the last time and now it does it all by itself.
Hello,
I am using Inkscape 0.92 on Windows 7.
I get the following log message when trying to run Text with LaTeX (GTK3) on the preamble file mathpreamble_sans.tex
---EDIT---
Cutting some of the log message.
Command "pdflatex c:\users\hyunmoon\appdata\local\temp\tmpl6zpvd\tmp.tex -interaction=nonstopmode -halt-on-error" failed (code 1):
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6630 64-bit)
entering extended mode
(c:/Users/Hyunmoon/AppData/Local/Temp/tmpl6zpvd/tmp.tex
LaTeX2e <2017-04-15>
Babel <3.18> and hyphenation patterns for 75 language(s) loaded.
Sorry, but pdflatex did not succeed.
The log file hopefully contains the information to get MiKTeX going again:
C:/Users/Hyunmoon/AppData/Local/MiKTeX/2.9/miktex/log/pdflatex.log
You may want to visit the MiKTeX project page, if you need help.
Traceback (most recent call last):
File "latextext_gtk3.py", line 150, in on_btnApply_clicked
self.run_callback()
File "latextext.py", line 465, in run
rendergroup = lat2svg.render(latex_string, self.options.preamble, self.options.fontsize, self.options.scale)
File "latextext.py", line 569, in render
raise RuntimeError()
RuntimeError
Hello,
I have been trying to use this plugin with Inkscape but when I receive this error:
Traceback (most recent call last):
File "latextext_gtk3.py", line 6, in <module>
import gi
ModuleNotFoundError: No module named 'gi'
I have tried to import in my terminal and gi can be imported.
Please help me !
When rendering I get an error message:
No protocol specified
However Latex seems to render fine. Any idea what could cause this?
(Inkscape 0.92.2, OpenSuse Leap 15)
I have no idea what is going on. It seems like there is an invalid character \xa0?
Traceback (most recent call last):
File "latextext_gtk3.py", line 158, in on_btnApply_clicked
self.run_callback()
File "/home/shawnpan/.config/inkscape/extensions/latextext.py", line 475, in run
rendergroup = lat2svg.render(latex_string, self.options.preamble, self.options.packages, self.options.fontsize, self.options.scale)
File "/home/shawnpan/.config/inkscape/extensions/latextext.py", line 563, in render
f_tex.write(texwrapper)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 291: ordinal not in range(128)
To use this extension you need to put in Inkscape in English, otherwise, the extension does not work
Thanks for this awesome project. Guess it's helping quite a lot of PhD students who don't have the time to write everything it TikZ!
It would be great to also support display-mode equations, detecting LaTeX code inside $$ $$ or [ ] environments
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.