Your message dated Mon, 29 Dec 2008 23:47:08 +0000
with message-id <[email protected]>
and subject line Bug#464154: fixed in inkscape 0.46-4
has caused the Debian Bug report #464154,
regarding inkscape: Rendering LaTeX formula is broken (etch)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
464154: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=464154
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: inkscape
Version: 0.44.1-1
Severity: normal
Tags: patch


Hi,

I'm unable to render LaTeX formulae with the menu entry
"Effects->Render->LateX Formula". An error message box appears:

pstoedit: version 3.44 / DLL interface 108 (build Mar 26 2006 - release build - 
g++ 4.0.3 (Debian 4.0.3-1)) : Copyright (C) 1993 - 2006 Wolfgang Glunz
Traceback (most recent call last):
  File "/usr/share/inkscape/extensions/eqtexsvg.py", line 121, in ?
    e.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 123, in affect
    self.effect()
  File "/usr/share/inkscape/extensions/eqtexsvg.py", line 107, in effect
    svg_open(self, svg_file)
  File "/usr/share/inkscape/extensions/eqtexsvg.py", line 49, in svg_open
    svg = open(filename, 'r')
IOError: [Errno 2] No such file or directory: '/tmp/inkscape-latex.tmp.svg'

When clicking "Ok", there is no formula output on the canvas.

In the (likely?) case that this bug won't be fixed in Etch, you can
manually fix it yourself:
- copy the attached eqtexsvg.py to /usr/share/inkscape/extensions/
- make sure the following packages are installed or install them:
  pstoedit, skencil, python-xml

eqtexsvg.py will be overwritten with each update of inkscape, if you
don't use dpkg-divert to prevent this:
  # dpkg-divert --add --rename \
                --divert /usr/share/inkscape/extensions/eqtexsvg.py.inkscape \
                         /usr/share/inkscape/extensions/eqtexsvg.py


Some more details:

Basically, what happens is that pstoedit (in the version shipped with
Etch) doesn't recognize the option "-f svg" and, therefore, does not
produce any output file.

I fixed this by adapting /usr/share/inkscape/extensions/eqtexsvg.py:
- use "pstoedit -f sk" (skencil format)
- convert SK file to SVG with "skconvert"

The existing svg_open() function can not parse the SVG file created by
skconvert, so I replaced svg_open() with a more recent version of
eqtexsvg.py (v0.45) and also added the function unittouu(), which was
taken from a more recent version of inkex.py.

I have not tested the current status of LaTeX formula rendering in
unstable.


cheers

        Daniel


-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-5-vserver-amd64
Locale: lang=de...@euro, lc_ctype=de...@euro (charmap=ISO-8859-15)

Versions of packages inkscape depends on:
ii  libatk1.0-0            1.12.4-3          The ATK accessibility toolkit
ii  libbonobo2-0           2.14.0-3          Bonobo CORBA interfaces library
ii  libc6                  2.3.6.ds1-13etch4 GNU C Library: Shared libraries
ii  libcairo2              1.2.4-4           The Cairo 2D vector graphics libra
ii  libdbus-1-3            1.0.2-1           simple interprocess messaging syst
ii  libfontconfig1         2.4.2-1.2         generic font configuration library
ii  libfreetype6           2.2.1-5+etch2     FreeType 2 font engine, shared lib
ii  libgc1c2               1:6.8-1           conservative garbage collector for
ii  libgcc1                1:4.1.1-21        GCC support library
ii  libgconf2-4            2.16.1-1          GNOME configuration database syste
ii  libglib2.0-0           2.12.4-2          The GLib library of C routines
ii  libglibmm-2.4-1c2a     2.12.0-1          C++ wrapper for the GLib toolkit (
ii  libgnomevfs2-0         1:2.14.2-7        GNOME virtual file-system (runtime
ii  libgtk2.0-0            2.8.20-7          The GTK+ graphical user interface 
ii  libgtkmm-2.4-1c2a      1:2.8.8-1         C++ wrappers for GTK+ 2.4 (shared 
ii  liblcms1               1.15-1            Color management library
ii  libloudmouth1-0        1.1.4-2           Lightweight C Jabber library
ii  liborbit2              1:2.14.3-0.2      libraries for ORBit2 - a CORBA ORB
ii  libpango1.0-0          1.14.8-5          Layout and rendering of internatio
ii  libpng12-0             1.2.15~beta5-1    PNG library - runtime
ii  libpopt0               1.10-3            lib for parsing cmdline parameters
ii  libsigc++-2.0-0c2a     2.0.17-2          type-safe Signal Framework for C++
ii  libstdc++6             4.1.1-21          The GNU Standard C++ Library v3
ii  libx11-6               2:1.0.3-7         X11 client-side library
ii  libxcursor1            1.1.7-4           X cursor management library
ii  libxext6               1:1.0.1-2         X11 miscellaneous extension librar
ii  libxfixes3             1:4.0.1-5         X11 miscellaneous 'fixes' extensio
ii  libxft2                2.1.8.2-8         FreeType-based font drawing librar
ii  libxi6                 1:1.0.1-4         X11 Input extension library
ii  libxinerama1           1:1.0.1-4.1       X11 Xinerama extension library
ii  libxml2                2.6.27.dfsg-2     GNOME XML library
ii  libxrandr2             2:1.1.0.2-5       X11 RandR extension library
ii  libxrender1            1:0.9.1-3         X Rendering Extension client libra
ii  libxslt1.1             1.1.19-1          XSLT processing library - runtime 
ii  zlib1g                 1:1.2.3-13        compression library - runtime

Versions of packages inkscape recommends:
ii  imagemagick         7:6.2.4.5.dfsg1-0.14 Image manipulation programs
ii  libwmf-bin          0.2.8.4-2            Windows metafile conversion tools
pn  perlmagick          <none>               (no description available)
ii  pstoedit            3.44-1               PostScript and PDF files to editab

-- debconf-show failed
#!/usr/bin/env python
# -*- coding: cp1252 -*-
"""
EQTEXSVG.py
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>
    - skconvert from the skencil package

Copyright (C) 2006 Julien Vitard, [email protected]

- I will try to code XML parsing, not the hard way ;-)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

"""

import inkex, os, tempfile, sys, xml.dom.minidom, re

def create_equation_tex(filename, equation):
    tex = open(filename, 'w')
    tex.write("""%% processed with EqTeXSVG.py
\documentclass{article}
\\usepackage{amsmath}
\\usepackage{amssymb}
\\thispagestyle{empty}
\\begin{document}
""")
    tex.write("$$\n")
    tex.write(equation)
    tex.write("\n$$\n")
    tex.write("\end{document}\n")
    tex.close()

#a dictionary of unit to user unit conversion factors
uuconv = {'in':90.0, 'pt':1.25, 'px':1, 'mm':3.5433070866, 'cm':35.433070866, 
'pc':15.0}
def unittouu(string):
    '''Returns userunits given a string representation of units in another 
system'''
    unit = re.compile('(%s)$' % '|'.join(uuconv.keys()))
    param = 
re.compile(r'(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)')

    p = param.match(string)
    u = unit.search(string)
    if p:
        retval = float(p.string[p.start():p.end()])
    else:
        retval = 0.0
    if u:
        try:
            return retval * uuconv[u.string[u.start():u.end()]]
        except KeyError:
            pass
    return retval
                        
def svg_open(self,filename):
    doc_width = unittouu(self.document.documentElement.getAttribute('width'))
    doc_height = unittouu(self.document.documentElement.getAttribute('height'))
    doc_sizeH = min(doc_width,doc_height)
    doc_sizeW = max(doc_width,doc_height)

    def clone_and_rewrite(self, node_in):
        if node_in.localName != 'svg':
            node_out = self.document.createElement('svg:' + node_in.localName)
            for i in range(0, node_in.attributes.length):
                name = node_in.attributes.item(i).name
                value = node_in.attributes.item(i).value
                node_out.setAttribute(name, value)
        else:
            node_out = self.document.createElement('svg:g')
        for c in node_in.childNodes:
            if c.localName in ('g', 'path', 'polyline', 'polygon'):
                child = clone_and_rewrite(self, c)
                if c.localName == 'g':
                    
child.setAttribute('transform','matrix('+str(doc_sizeH/700.)+',0,0,'+str(doc_sizeH/700.)+','+str(-doc_sizeH*0.25)+','+str(doc_sizeW*0.75)+')')
                node_out.appendChild(child)

        return node_out

    doc = xml.dom.minidom.parse(filename)
    svg = doc.getElementsByTagName('svg')[0]
    group = clone_and_rewrite(self, svg)
    self.current_layer.appendChild(group)


class EQTEXSVG(inkex.Effect):
    def __init__(self):
        inkex.Effect.__init__(self)
        self.OptionParser.add_option("-f", "--formule",
                        action="store", type="string", 
                        dest="formule", default=10.0,
                        help="Formule LaTeX")
    def effect(self):
        
        base_file = os.path.join(tempfile.gettempdir(), "inkscape-latex.tmp")
        latex_file = base_file + ".tex"
        create_equation_tex(latex_file, self.options.formule)

        out_file = os.path.join(tempfile.gettempdir(), 
"inkscape-latex.tmp.output")
        os.system('latex -output-directory=' + tempfile.gettempdir() + ' ' + 
latex_file + '> ' + out_file)

        ps_file = base_file + ".ps"
        dvi_file = base_file + ".dvi"
        svg_file = base_file + ".svg"
        sk_file = base_file + ".sk"
        os.system('dvips -q -f -E -D 600 -y 5000 -o ' + ps_file + ' ' + 
dvi_file)
        #        os.system('pstoedit -f svg -dt -ssp ' + ps_file + ' ' + 
svg_file + '>> ' + out_file)
        os.system('exec 3>&1; ( pstoedit -f sk -dt -ssp ' + ps_file + ' ' + 
sk_file + ' 2>&1 >&3 3>&- | grep -v ^pstoedit >&2 3>&- ) >>' + out_file + '; 
exec 3>&-')
        os.system('LANG=C skconvert ' + sk_file + ' ' + svg_file + '>> ' + 
out_file)
        # ouvrir le svg et remplacer #7F7F7F par #000000
        svg_open(self, svg_file)

        # clean up
        aux_file = base_file + ".aux"
        log_file = base_file + ".log"
        os.remove(latex_file)
        os.remove(aux_file)
        os.remove(log_file)
        os.remove(dvi_file)
        os.remove(ps_file)
        os.remove(sk_file)
        os.remove(svg_file)
        os.remove(out_file)
        
e = EQTEXSVG()
e.affect()

--- End Message ---
--- Begin Message ---
Source: inkscape
Source-Version: 0.46-4

We believe that the bug you reported is fixed in the latest version of
inkscape, which is due to be installed in the Debian FTP archive:

inkscape_0.46-4.diff.gz
  to pool/main/i/inkscape/inkscape_0.46-4.diff.gz
inkscape_0.46-4.dsc
  to pool/main/i/inkscape/inkscape_0.46-4.dsc
inkscape_0.46-4_powerpc.deb
  to pool/main/i/inkscape/inkscape_0.46-4_powerpc.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Wolfram Quester <[email protected]> (supplier of updated inkscape package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sun, 28 Dec 2008 17:35:10 +0100
Source: inkscape
Binary: inkscape
Architecture: source powerpc
Version: 0.46-4
Distribution: unstable
Urgency: low
Maintainer: Wolfram Quester <[email protected]>
Changed-By: Wolfram Quester <[email protected]>
Description: 
 inkscape   - vector-based drawing program
Closes: 428226 464154 471109 496785 504469 505660 506217 506285 508690 508692
Changes: 
 inkscape (0.46-4) unstable; urgency=low
 .
   * Fix lintian warning: menu-item-uses-apps-section (Closes: #508692).
   * Add debian/watch file (Closes: #508690).
   * Add support in bash completion file for jpeg, svgz, and pdf
     (Closes: #428226).
   * Add patch to give back LaTeX formula rendering option
     (Closes: #464154, #506285).
   * Thanks Salvatore Bonaccorso for his patches :-)
   * Add patch by Martin Michlmayr <[email protected]> to make inkscape compile
     with gcc 4.4 (Closes: #505660)
   * Suggest python-uniconvertor and add patch by Andreas Wenning to use it in
     the .cdr input plugin instead of the old uniconv (Closes: #471109, 
#506217).
   * Suggest libgnomevfs2-extra which is needed to make
     "Import From Open Clip Art Library" work (Closes: #496785).
   * Suggest libsvg-perl , as the txt2svg extension needs it (Closes: #504469).
   * upload sponsored by Guido Guenther <[email protected]>
Checksums-Sha1: 
 1c8bff2a4cb486b199c4c02f3ae3976164dfda5e 1387 inkscape_0.46-4.dsc
 a959150e8d6e8faa6dbdd96643145f656a16f948 22518 inkscape_0.46-4.diff.gz
 36564989f77d0d61f65afaebd44fb37ef39c6ae5 18601626 inkscape_0.46-4_powerpc.deb
Checksums-Sha256: 
 eb00279b8d46bd4c179ce46571d7ae8a204e589c46e48fdfa6c07a05c2785db5 1387 
inkscape_0.46-4.dsc
 7f1be6811c80b9ee613e642531b980005b26d0a770cecbe68b6861fca930b5d1 22518 
inkscape_0.46-4.diff.gz
 efa7419fccef82a6c1d1a679132efe2f1ae701a2a11dd1fac600dca733343245 18601626 
inkscape_0.46-4_powerpc.deb
Files: 
 387251bada0fcf9ea11b7d0a0a138c61 1387 graphics optional inkscape_0.46-4.dsc
 77e469ac9dc7ad4bc430a9fda932395a 22518 graphics optional 
inkscape_0.46-4.diff.gz
 48ded2543eb9e32e284c8d90baf3a7bf 18601626 graphics optional 
inkscape_0.46-4_powerpc.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFJWVwXn88szT8+ZCYRAteTAJ0avX9/YfXndguv/r0hvmMq3/dG7ACdGFgM
QnhMHboKSjwYlVJ1pgZGADg=
=uSWy
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to