Getting textext to work within Inkscape on the Mac

Post questions on how to use or achieve an effect in Inkscape.
Dan Cook

Getting textext to work within Inkscape on the Mac

Postby Dan Cook » Fri Oct 17, 2008 9:50 pm

Hi all,

I use Inkscape regularly for professional and academic purposes. The ability to draw and have the files be available cross-platform is invaluable, as this frees me to spend time creating a good quality illustration which I can use on any platform and software application. It also allows me to tease my colleagues who create their illustrations using PowerPoint. :-)

I frequently use the textext extension for placing LaTeX symbols and equations into my drawings. Till now, I have been doing this using the Windows version of Inkscape. Now, I am keenly interested in getting the textext extension to work on the Mac. After searching the web, it appears that there is no simple solution for getting it to work. After installing various packages using MacPorts, I was at last able to get textext to run and allow me enter LaTeX source. However, the rendering failed with the following message:

Traceback (most recent call last):
File "Contents/Resources/extensions/textext.py", line 933, in ?
e.affect()
File "/Applications/Inkscape.app/Contents/Resources/extensions/inkex.py", line 154, in affect
self.effect()
File "Contents/Resources/extensions/textext.py", line 368, in effect
asker.ask(lambda t, p, s: self.do_convert(t, p, s,
File "Contents/Resources/extensions/textext.py", line 292, in ask
self.callback(self.text, self.preamble_file, self.scale_factor)
File "Contents/Resources/extensions/textext.py", line 369, in <lambda>
converter_cls, old_node))
File "Contents/Resources/extensions/textext.py", line 387, in do_convert
new_node = converter.convert(text, preamble_file, scale_factor)
File "Contents/Resources/extensions/textext.py", line 750, in convert
self.tex_to_pdf(latex_text, preamble_file)
File "Contents/Resources/extensions/textext.py", line 727, in tex_to_pdf
exec_command(['pdflatex', self.tmp('tex')] + latexOpts)
File "Contents/Resources/extensions/textext.py", line 621, in exec_command
raise RuntimeError("Command %s failed (code %d): %s"
RuntimeError: Command pdflatex /tmp/tmpTg3wn9/tmp.tex -interaction=nonstopmode -halt-on-error failed (code 1):


Getting textext to work using precompiled binaries/packages on Windows is pretty painless, if you follow the directions here: http://www.elisanet.fi/ptvirtan/software/textext/.

My question is this: The current info on the web seems to indicate that getting textext to function on the Mac is a nontrivial matter. Why is this? Can anyone shed some light on getting textext to run using Mac application .dmg version of Inkscape? I am running MacOS 10.4 on an Intel MacBook. If the answer turns out to involve upgrading to 10.5, that is OK. Mostly what I need is a set of steps I can follow that will work.

Sincerely,

Dan Cook


Guest

Re: Getting textext to work within Inkscape on the Mac

Postby Guest » Sat Nov 15, 2008 8:18 pm

Dan Cook wrote:Hi all,

I use Inkscape regularly for professional and academic purposes. The ability to draw and have the files be available cross-platform is invaluable, as this frees me to spend time creating a good quality illustration which I can use on any platform and software application. It also allows me to tease my colleagues who create their illustrations using PowerPoint. :-)

I frequently use the textext extension for placing LaTeX symbols and equations into my drawings. Till now, I have been doing this using the Windows version of Inkscape. Now, I am keenly interested in getting the textext extension to work on the Mac. After searching the web, it appears that there is no simple solution for getting it to work. After installing various packages using MacPorts, I was at last able to get textext to run and allow me enter LaTeX source. However, the rendering failed with the following message:

Traceback (most recent call last):
File "Contents/Resources/extensions/textext.py", line 933, in ?
e.affect()
File "/Applications/Inkscape.app/Contents/Resources/extensions/inkex.py", line 154, in affect
self.effect()
File "Contents/Resources/extensions/textext.py", line 368, in effect
asker.ask(lambda t, p, s: self.do_convert(t, p, s,
File "Contents/Resources/extensions/textext.py", line 292, in ask
self.callback(self.text, self.preamble_file, self.scale_factor)
File "Contents/Resources/extensions/textext.py", line 369, in <lambda>
converter_cls, old_node))
File "Contents/Resources/extensions/textext.py", line 387, in do_convert
new_node = converter.convert(text, preamble_file, scale_factor)
File "Contents/Resources/extensions/textext.py", line 750, in convert
self.tex_to_pdf(latex_text, preamble_file)
File "Contents/Resources/extensions/textext.py", line 727, in tex_to_pdf
exec_command(['pdflatex', self.tmp('tex')] + latexOpts)
File "Contents/Resources/extensions/textext.py", line 621, in exec_command
raise RuntimeError("Command %s failed (code %d): %s"
RuntimeError: Command pdflatex /tmp/tmpTg3wn9/tmp.tex -interaction=nonstopmode -halt-on-error failed (code 1):


Getting textext to work using precompiled binaries/packages on Windows is pretty painless, if you follow the directions here: http://www.elisanet.fi/ptvirtan/software/textext/.

My question is this: The current info on the web seems to indicate that getting textext to function on the Mac is a nontrivial matter. Why is this? Can anyone shed some light on getting textext to run using Mac application .dmg version of Inkscape? I am running MacOS 10.4 on an Intel MacBook. If the answer turns out to involve upgrading to 10.5, that is OK. Mostly what I need is a set of steps I can follow that will work.

Sincerely,

Dan Cook



Try replacing

exec_command(['pdflatex', self.tmp('tex')] + latexOpts)

in textext.py

with

exec_command(['/usr/textbin/pdflatex', self.tmp('tex')] + latexOpts)


(or whatever the full path is to your pdflatex

Guest

Re: Getting textext to work within Inkscape on the Mac

Postby Guest » Sat Nov 15, 2008 8:24 pm

OOPS, typo. Should be:

Try replacing

exec_command(['pdflatex', self.tmp('tex')] + latexOpts)

in textext.py

with

exec_command(['/usr/texbin/pdflatex', self.tmp('tex')] + latexOpts)


(or whatever the full path is to your pdflatex)

nick_h
Posts: 8
Joined: Fri Apr 17, 2009 4:25 am

Re: Getting textext to work within Inkscape on the Mac

Postby nick_h » Tue May 19, 2009 7:55 am

I've never had the slightest luck in getting textext to work and I use Vista. If you have XeLaTeX you might be interested in this:

http://www.inkscapeforum.com/viewtopic.php?f=6&t=3090

This is how I use LaTeX with Windows (and Inkscape).

Regards, N.


Return to “Help with using Inkscape”