Inkscape and textext - header files

Post questions on how to use or achieve an effect in Inkscape.
keenPenguin
Posts: 5
Joined: Tue Sep 08, 2009 7:28 pm

Inkscape and textext - header files

Postby keenPenguin » Tue Sep 08, 2009 7:55 pm

Hello,

I am using Inkscape 0.46 on Ubuntu 8.04. I have installed textext successfully, and as long as I do not specify a header file, the code is compiled wonderfully. But in order to create latex textboxes for scientific posters, I have stumbled upon this page:

http://gael-varoquaux.info/computers/po ... ribus.html

The author creates textboxes using latex beamer. On the above link, he gives both a header file and the code required to create a textbox. Now, I created a file header.inc, copied the header from the page into the text file, and then launched Inkscape and selected the header file in textext. Then, I copied the code for the textbox from the above page to the textext text window. But unfortunately, it didn't compile. Here's a screenshot showing the problem (I've have also removed the french accents to avoid further latex trouble):

http://img2.abload.de/img/textext_problemcrvj.png

And here is the complete error code that textext gives me:

Code: Select all

Traceback (most recent call last):
  File "/home/alex/.inkscape/extensions/textext.py", line 210, in cb_ok
    self.callback(self.text, self.preamble_file, self.scale_factor)
  File "/home/alex/.inkscape/extensions/textext.py", line 369, in <lambda>
    converter_cls, old_node))
  File "/home/alex/.inkscape/extensions/textext.py", line 387, in do_convert
    new_node = converter.convert(text, preamble_file, scale_factor)
  File "/home/alex/.inkscape/extensions/textext.py", line 750, in convert
    self.tex_to_pdf(latex_text, preamble_file)
  File "/home/alex/.inkscape/extensions/textext.py", line 727, in tex_to_pdf
    exec_command(['pdflatex', self.tmp('tex')] + latexOpts)
  File "/home/alex/.inkscape/extensions/textext.py", line 596, in exec_command
    % (' '.join(cmd), p.returncode, out + err))
RuntimeError: Command pdflatex /tmp/tmpfD3zPw/tmp.tex -interaction=nonstopmode -halt-on-error failed (code 1): This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
 %&-line parsing enabled.
entering extended mode
(/tmp/tmpfD3zPw/tmp.tex
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, german, ngerman, loaded.
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))

! LaTeX Error: Two \documentclass or \documentstyle commands.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                             
                                                 
l.3 ...   \documentclass[slidestop,11pt,compress]{
                                                  beamer}
?
! Emergency stop.
 ...                                             
                                                 
l.3 ...   \documentclass[slidestop,11pt,compress]{
                                                  beamer}
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on tmp.log.



I also tried other (more simple and non-beamer) preambles, but I ended up not being able to compile themn. What strikes me is the line "Two \documentclass or \documentstyle commands". Does that perhaps mean that textext always uses some kind of header file (including a documentclass statement) and uses my header file only as a supplement to his own and therefore conflicts in having multiple documentclass statements?

I'd really appreciate some help here!

keenPenguin with best regards!

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Inkscape and textext - header files

Postby ~suv » Wed Sep 09, 2009 6:40 am

I don't use LaTeX myself - but just from reading <http://gael-varoquaux.info/computers/posters/LaTeX-scribus.html> AFAIU it's intended to be used to create a separate document for each textblock which is then imported as PDF into Scribus.

That means that the code posted on that page is not meant to be included into another LaTeX document, but (after conversion with the mentioned python-script to PDF) into a 'global' Scribus document used to layout several textboxes on one page.

keenPenguin
Posts: 5
Joined: Tue Sep 08, 2009 7:28 pm

Re: Inkscape and textext - header files

Postby keenPenguin » Wed Sep 09, 2009 8:29 am

Thanks suv,

you're right, I didn't see that.

But still, the complaint about the two documentclass statements is strange. I also did try a simple hello world from a simple latex preamble saved as header.inc., but it didn't work either.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Inkscape and textext - header files

Postby ~suv » Wed Sep 09, 2009 8:46 am

Maybe related to this issue on the TeX Text issue tracker?

pv / textext / issues / #3 - LaTeX documentclass cannot be changed. — bitbucket.org:
<http://bitbucket.org/pv/textext/issue/3/latex-documentclass-cannot-be-changed>

keenPenguin
Posts: 5
Joined: Tue Sep 08, 2009 7:28 pm

Re: Inkscape and textext - header files

Postby keenPenguin » Wed Sep 09, 2009 11:51 pm

Yeah, seems to be a similar problem.

It's actually a pity that things are so complicated with textext, I mean it would be wonderful if I could insert blocks written in tex (similar to the above link) into Inkscape, even without the frame. Inkscape is good for scientific posters, and surely more convenient than Latex when it comes to posters. To combine them would be great...

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Inkscape and textext - header files

Postby ~suv » Thu Sep 10, 2009 12:38 am

Have you tried the LaTeX extension that is included in the bundled Inkscape extensions? AFAIK the version included in the prerelease builds of 0.47pre or current devel snapshots works out-of-the-box (with default LaTeX installation outside of Inkscape).

'Extensions > Render > LaTeX formula…'

eqtexsvg.py

Code: Select all

functions for converting LaTeX equation string into SVG path
This extension need, to work properly:
    - a TeX/LaTeX distribution (MiKTeX ...)
    - pstoedit software: <http://www.pstoedit.net/pstoedit>

Copyright (C) 2006 Julien Vitard <[email protected]>


Return to “Help with using Inkscape”