Where to find LaTeX command in the menu

Post questions on how to use or achieve an effect in Inkscape.
zaradek
Posts: 14
Joined: Fri Apr 25, 2008 5:06 am

Where to find LaTeX command in the menu

Postby zaradek » Fri Apr 25, 2008 5:21 am

Hello,

I've read a lot about the LaTeX formula rendering capabilities of Inkscape. It is said to be under the menu item "Effects > Render > LaTeX". My big problem is that I can't find this "LaTeX" item in the "Render" menu: http://screencast.com/t/KBmkArdovP.
Please tell me me where is this function.

Cheers, Máté

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: Where to find LaTeX command in the menu

Postby sas » Fri Apr 25, 2008 7:56 pm

You need to have Ghostscript, LaTeX and pstoedit (with the SVG plugin) installed, and they must all be in the path. Once you've done this, the LaTeX effect should appear on the menu the next time you start Inkscape. (However, it may not actually work, as I think it's broken in 0.46. So you may also need to download a fixed version of eqtexsvg.py in order to use it.)

zaradek
Posts: 14
Joined: Fri Apr 25, 2008 5:06 am

Re: Where to find LaTeX command in the menu

Postby zaradek » Fri Apr 25, 2008 8:19 pm

I have Ghostscript and MikTeX under Windows XP, and I use them all the times. I installed pstoedit from the site http://www.pstoedit.net/pstoedit by the link "binary for Windows 9x/2K/NT/XP/Vista". (I don't know if it contains the SVG plugin or where can I find it separately.)

But in spite of these LaTeX menu item sill doesn't appeared.

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: Where to find LaTeX command in the menu

Postby sas » Fri Apr 25, 2008 9:54 pm

You should be able to find out why the extension isn't loading by looking at the details for "LaTeX formula" in your extension-errors.log file. On Windows XP, this file will usually be in the directory C:\Documents and Settings\<username>\Application Data\Inkscape (where <username> is your Windows username).

zaradek wrote:I installed pstoedit from the site http://www.pstoedit.net/pstoedit by the link "binary for Windows 9x/2K/NT/XP/Vista". (I don't know if it contains the SVG plugin or where can I find it separately.)

See the link labelled "additional plugins" on that page.

zaradek
Posts: 14
Joined: Fri Apr 25, 2008 5:06 am

Re: Where to find LaTeX command in the menu

Postby zaradek » Fri Apr 25, 2008 10:13 pm

The log file says:

Code: Select all

Extension "LaTeX formula" failed to load because a dependency was not met.
Dependency:
  type: executable
  location: path
  string: pstoedit

Pstoedit is installed at C:\Program Files\pstoedit. Shell I move it to somewhere else to make Inkscape to find it?

zaradek
Posts: 14
Joined: Fri Apr 25, 2008 5:06 am

Re: Where to find LaTeX command in the menu

Postby zaradek » Fri Apr 25, 2008 10:44 pm

I moved the folder C:\Program Files\pstoedit into the folder C:\Program Files\Inkscape, and the LaTeX Item appeared in the Render menu.
I downloaded the additional plugins, but as it turnd out they were already in the C:\Program Files\pstoedit folder by the pstoedit installer.

But I still couldn't create formula, that hapens: http://screencast.com/t/NfR3Nvuh0. Did you mean this saying "it may not actually work"? Where can I find the fixed eqtexsvg.py?

zaradek
Posts: 14
Joined: Fri Apr 25, 2008 5:06 am

Re: Where to find LaTeX command in the menu

Postby zaradek » Fri Apr 25, 2008 10:58 pm

I downloaded from the page http://julvitard.free.fr/eqtexsvg another eqtexsvg.py. It helped, so I'm over my last problem with this, but I have the next one: http://screencast.com/t/nqqMoRDsoq. I don't understand, because the tex file created by Inkscape is compilable by MikTeX. What's the problem?

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: Where to find LaTeX command in the menu

Postby sas » Fri Apr 25, 2008 11:05 pm

zaradek wrote:I moved the folder C:\Program Files\pstoedit into the folder C:\Program Files\Inkscape, and the LaTeX Item appeared in the Render menu.

That should be OK, although it would have have been better to add C:\Program Files\pstoedit to the system path.

But I still couldn't create formula, that hapens: http://screencast.com/t/NfR3Nvuh0. Did you mean this saying "it may not actually work"?

Yes. (Looks like it could also do with some better error reporting...)

Where can I find the fixed eqtexsvg.py?

Try this development version: eqtexsvg.py. Put it in C:\Program Files\Inkscape\share\extensions (replacing your current eqtexsvg.py).

zaradek
Posts: 14
Joined: Fri Apr 25, 2008 5:06 am

Re: Where to find LaTeX command in the menu

Postby zaradek » Fri Apr 25, 2008 11:18 pm

With this development version I even don't get the tex file, and it seems like this in Inkscape: http://screencast.com/t/jAcocS6r9y7

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: Where to find LaTeX command in the menu

Postby sas » Sat Apr 26, 2008 5:11 am

Sorry, that was the wrong version. Try this one instead: eqtexsvg.py. (I was trying to avoid the most recent SVN version, because I don't think it works on Windows. But somehow I linked to an earlier version than I intended.)

zaradek
Posts: 14
Joined: Fri Apr 25, 2008 5:06 am

Re: Where to find LaTeX command in the menu

Postby zaradek » Sat Apr 26, 2008 5:32 am

I tried this version as well, although the error message changed again, but it still has some problem.
Executing the formula it gives first this error message: http://screencast.com/t/x4nM3iIb. It means that

Code: Select all

pstoedit.exe - Entering point wasn't found
       The entering point of the procedure (__iob_func) wasn't found in the DLL (MSVR70.dll).

After answering OK four times the following error message appears:

Code: Select all

Traceback (most recent call last):
  File "C:\Program Files\Inkscape\share\extensions\eqtexsvg.py", line 121, in <module>
    e.affect()
  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 154, in affect
    self.effect()
  File "C:\Program Files\Inkscape\share\extensions\eqtexsvg.py", line 116, in effect
    svg_open(self, svg_file)
  File "C:\Program Files\Inkscape\share\extensions\eqtexsvg.py", line 69, in svg_open
    doc = inkex.etree.parse(filename)
  File "etree.pyx", line 1845, in etree.parse
  File "parser.pxi", line 928, in etree._parseDocument
  File "parser.pxi", line 932, in etree._parseDocumentFromURL
  File "parser.pxi", line 849, in etree._parseDocFromFile
  File "parser.pxi", line 557, in etree._BaseParser._parseDocFromFile
  File "parser.pxi", line 631, in etree._handleParseResult
  File "parser.pxi", line 597, in etree._raiseParseError
IOError: Error reading file 'c:\docume~1\salat\locals~1\temp\inkscape-8ulrsf\eq.svg': failed to load external entity "file:///c%3A/docume~1/salat/locals~1/temp/inkscape-8ulrsf/eq.svg"

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: Where to find LaTeX command in the menu

Postby sas » Sat Apr 26, 2008 6:22 am

I've eventually got round to installing pstoedit and trying this out myself. The revision 18267 eqtexsvg.py linked in my last post works for me on Windows XP (whereas the current SVN version doesn't).

In your Inkscape directory there's a file called msvcr70.dll. It's very old, and has no entry point called __iob_func. This is the cause of your latest problem (because you put pstoedit.exe in that directory). It's probably safe just to delete this old msvcr70.dll (but putting the pstoedit files back in their own directory, and adding that directory to the system path would be better, I think).

zaradek
Posts: 14
Joined: Fri Apr 25, 2008 5:06 am

Re: Where to find LaTeX command in the menu

Postby zaradek » Sat Apr 26, 2008 6:45 am

I deleted C:\Program Files\Inkscape\msvcr70.dll, and both Effect>Render>LaTeX formula and TexText plugin started working. (I put back pstoedit and added the directory to system path when you told it.)

So, thanks all your help! That's what I wanted. :)

chenkent
Posts: 6
Joined: Sun Apr 27, 2008 6:40 pm

Re: Where to find LaTeX command in the menu

Postby chenkent » Sun Apr 27, 2008 6:50 pm

Hello, I am also eager to use Latex formula and follow the instructions above. But I still got the following errors. Could I get some help as well. In my case, it is Windows XP and Inkscape is installed in "I:\Program File\Inkscape" and the others are in "C:\Program Files\GPLGS", "C:\Program Files\MiKTeX 2.7\miktex\bin" and "C:\Program Files\pstoedit". And I have listed them in the path.

Code: Select all

Traceback (most recent call last):
  File "I:\Program File\Inkscape\share\extensions\eqtexsvg.py", line 121, in <module>
    e.affect()
  File "I:\Program File\Inkscape\share\extensions\inkex.py", line 154, in affect
    self.effect()
  File "I:\Program File\Inkscape\share\extensions\eqtexsvg.py", line 116, in effect
    svg_open(self, svg_file)
  File "I:\Program File\Inkscape\share\extensions\eqtexsvg.py", line 69, in svg_open
    doc = inkex.etree.parse(filename)
  File "etree.pyx", line 1845, in etree.parse
  File "parser.pxi", line 928, in etree._parseDocument
  File "parser.pxi", line 932, in etree._parseDocumentFromURL
  File "parser.pxi", line 849, in etree._parseDocFromFile
  File "parser.pxi", line 557, in etree._BaseParser._parseDocFromFile
  File "parser.pxi", line 631, in etree._handleParseResult
  File "parser.pxi", line 602, in etree._raiseParseError
etree.XMLSyntaxError: line 1: Start tag expected, '<' not found

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: Where to find LaTeX command in the menu

Postby sas » Sun Apr 27, 2008 10:00 pm

I've uploaded a new version of eqtexsvg.py to bug 55273 that fixes some potential problems on Windows. Here it is: eqtexsvg.py. I can't be sure that this will fix your problem, because I'm not really sure what your problem is (it looks like the SVG file isn't being generated, but that could be for a number of different reasons).

chenkent
Posts: 6
Joined: Sun Apr 27, 2008 6:40 pm

Re: Where to find LaTeX command in the menu

Postby chenkent » Mon Apr 28, 2008 4:12 am

I have download this "eqtexsvg.py," but it seems doesn't work for me. The error is still the same. How to debug SVG generation problem. I am not a programmer. If that is too difficult, I will give up. Thanks.

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: Where to find LaTeX command in the menu

Postby sas » Mon Apr 28, 2008 7:39 am

You could try the following:

Open eqtexsvg.py in Notepad, and find the line that begins

Code: Select all

        os.system('cd "%s" %s

(This is line 122, towards the end of the file.) In this line, change "cd" to "pushd". Then save the file. Does the LaTeX effect work with this modified eqtexsvg.py? (The point here is that cd doesn't change drive, whereas pushd does. As you're using two drives, this might matter.)

chenkent
Posts: 6
Joined: Sun Apr 27, 2008 6:40 pm

Re: Where to find LaTeX command in the menu

Postby chenkent » Mon Apr 28, 2008 5:50 pm

The error message change to this one.

Code: Select all

invalid LaTeX input:
$A_B$
temporary files were left in: I:\Program File\Inkscape\share\extensions


If the problem is caused by the two drives, I will put them into one and try again

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: Where to find LaTeX command in the menu

Postby sas » Mon Apr 28, 2008 7:20 pm

At the moment, it doesn't look like it's caused by using two drives.

What you are reporting is strange, because the error you're now getting occurs before the place where you changed "cd" to "pushd", and can't be caused by that change. What else has changed? Has all your testing been done under the same Windows user account?

Another thing that's strange is that it's reporting leaving temporary files in your Inkscape extensions directory. That shouldn't be possible, since the Python script should create a new subdirectory in your temp directory for this purpose. Can you look in I:\Program File\Inkscape\share\extensions and see if there are any files there with names of the form eq.* (e.g., eq.tex, eq.out, eq.ps, etc.)? If there are files with such names, what do they contain?

Something that's just occurred to me: Do you have some antivirus software that might be stopping the Python script from writing to the hard disk?

chenkent
Posts: 6
Joined: Sun Apr 27, 2008 6:40 pm

Re: Where to find LaTeX command in the menu

Postby chenkent » Mon Apr 28, 2008 10:52 pm

Sorry I am a little bit confused by these different versions of eqtexsvg.py and not sure my current condition. I try my best to report it below.
1. I reinstalled Inkscape to C:\Program Files.
2. I removed msvcr70.dll and checked path(they are C:\Program Files\Inkscape\share\extensions\;C:\Program Files\MiKTeX 2.7\miktex\bin\; C:\Program Files\pstoedit\;C:\Program Files\GPLGS\;C:\Program Files\Ghostgum\gsview\;)
3. I used eqtexsvg.py from http://julvitard.free.fr/eqtexsvg. It creates eq.tex (the contain is just what I type) in C:\Program Files\Inkscape\share\extensions but with error as below.

Code: Select all

invalid LaTeX input:
$A_B$
temporary files were left in: C:\Program Files\Inkscape\share\extensions

4. I tried the new version of eqtexsvg.py that you uploaded with respect to bug 55273. No eq.tex is generated and errors looks the same as before:

Code: Select all

Traceback (most recent call last):
 Traceback (most recent call last):
  File "C:\Program Files\Inkscape\share\extensions\eqtexsvg.py", line 138, in <module>
    e.affect()
  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 154, in affect
    self.effect()
  File "C:\Program Files\Inkscape\share\extensions\eqtexsvg.py", line 133, in effect
    svg_open(self, svg_file)
  File "C:\Program Files\Inkscape\share\extensions\eqtexsvg.py", line 69, in svg_open
    doc = inkex.etree.parse(filename)
  File "etree.pyx", line 1845, in etree.parse
  File "parser.pxi", line 928, in etree._parseDocument
  File "parser.pxi", line 932, in etree._parseDocumentFromURL
  File "parser.pxi", line 849, in etree._parseDocFromFile
  File "parser.pxi", line 557, in etree._BaseParser._parseDocFromFile
  File "parser.pxi", line 631, in etree._handleParseResult
  File "parser.pxi", line 602, in etree._raiseParseError
etree.XMLSyntaxError: line 1: Start tag expected, '<' not found

Please help to look what is the problem.

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: Where to find LaTeX command in the menu

Postby sas » Tue Apr 29, 2008 1:31 am

chenkent wrote:3. I used eqtexsvg.py from http://julvitard.free.fr/eqtexsvg. It creates eq.tex (the contain is just what I type) in C:\Program Files\Inkscape\share\extensions but with error as below.

Code: Select all

invalid LaTeX input:
$A_B$
temporary files were left in: C:\Program Files\Inkscape\share\extensions

Yes, that's as expected. Please delete that version of eqtexsvg.py - it's for Inkscape 0.45 and doesn't really work on Windows anyway.

Please help to look what is the problem.

Yes, but you need to follow instructions. I spent quite some time trying to work out how the script you were supposed to be running could possibly fail at that point with that error message. Now it turns out that you were running a different script altogether, and it's not surprising that it was failing like that.

4. I tried the new version of eqtexsvg.py that you uploaded with respect to bug 55273. No eq.tex is generated

It is generated, but you're looking in the wrong place for it.

Now, please follow these instructions carefully:

1) Download the current SVN version of eqtexsvg.py: eqtexsvg.py. Put it in C:\Program Files\Inkscape\share\extensions (replacing whatever version you have there at the moment).

2) Run the LaTeX effect in Inkscape. (It will fail, but it should generate some temporary files which may help determine why it failed.)

3) Open a command prompt (Start -> Run -> cmd.exe -> OK).

4) Click the icon in the top left corner of the command prompt window, select Properties, and on the Options tab make sure that the box for QuickEdit Mode is checked. Click OK (and OK again, if necessary).

5) Type the following at the command prompt:

Code: Select all

cd %temp% && dir /ad /od

(and then hit the Enter key, of course). You should see some inkscape- directories. You need to change directory into the last of these. So if, for example, the last one is called inkscape-3obj3q then type

Code: Select all

cd inkscape-3obj3q

at the command prompt. Now see what's there by typing

Code: Select all

dir

Post the resulting directory listing here. (You can copy it off the screen: select a region by dragging the mouse pointer, hit enter to copy, and paste it into your browser.)

Also post the contents of each of the files in this directory (except eq.dvi, which is binary). For example, to get the contents of the eq.out file, you can type

Code: Select all

type eq.out

and then copy the output off the screen.

chenkent
Posts: 6
Joined: Sun Apr 27, 2008 6:40 pm

Re: Where to find LaTeX command in the menu

Postby chenkent » Tue Apr 29, 2008 5:36 am

Files in temp directory are:
04/28/2008 08:54 PM 9 eq.aux
04/28/2008 08:54 PM 256 eq.dvi
04/28/2008 08:54 PM 0 eq.err
04/28/2008 08:54 PM 4,670 eq.log
04/28/2008 08:54 PM 570 eq.out
04/28/2008 08:54 PM 11,888 eq.ps
04/28/2008 08:54 PM 0 eq.svg
04/28/2008 08:54 PM 189 eq.tex

The content of eq.out is:
C:\DOCUME~1\kent\LOCALS~1\Temp\inkscape-z2bv4b>type eq.out
pstoedit: version 3.45 / DLL interface 108 (build Sep 10 2007 - release build -
MS VC++ 1300) : Copyright (C) 1993 - 2007 Wolfgang Glunz
Can't load I:\program file\Metagraf-5\gstools\gs5.50\gsdll32.dll
PostScript/PDF Interpreter finished. Return status -1 executed command : I:\prog
ram file\Metagraf-5\gstools\gs5.50\gsdll32.dll -II:\program file\Metagraf-5\gsto
ols\gs5.50;I:\program file\Metagraf-5\gstools\gs5.50\fonts -q -dDELAYBIND -dWRIT
ESYSTEMDICT -dNODISPLAY -dNOEPS C:/DOCUME~1/kent/LOCALS~1/Temp/psin2
The interpreter seems to have failed, cannot proceed !

Yes! Now I can see the problem. The script loads the .dll library from a place where it was there but no longer now. How can I make a right path for accessing gsdll32.dll? In my system, the right place is "C:\Program Files\gs\gs8.61\bin" and "C:\Program Files\gs\fonts."(I already set them in PATH)

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: Where to find LaTeX command in the menu

Postby sas » Tue Apr 29, 2008 8:04 am

So it's a pstoedit problem. Type

Code: Select all

pstoedit -help -v >pstoedit.txt

at the command prompt, then take a look at the file pstoedit.txt that you get. Somewhere in it you should find the line "Looking up where to find the PostScript interpreter", followed by an explanation of why it's trying to use Ghostscript 5.50. Once you know that, you'll probably be able to make it use Ghostscript 8.61 instead.

chenkent
Posts: 6
Joined: Sun Apr 27, 2008 6:40 pm

Re: Where to find LaTeX command in the menu

Postby chenkent » Tue Apr 29, 2008 7:13 pm

Really thanks. I found the reason why pstoedit cannot find the right "PostScript interpreter." Pstoedit calls the "default PostScript interpreter" and looks for the default setting in C:\Documents and Settings\username\gsview32.ini. Changing values of parameters "GhostscriptDLL" and "GhostscriptInclude" to right places or simply removing the file(it will start a search function and find the latest ps files) can solve the problem. In my case I just removed the gsview32.ini and the LaTeX rendering works in Inkscape.
Thank you very much.

PsyD

Re: Where to find LaTeX command in the menu

Postby PsyD » Sun May 04, 2008 7:27 pm

Hello!

I also have some problems with it. I have,

1. Inkscape 046
2.The latest version of the current SVN version of eqtexsvg.py
3. C:\Program Files\MiKTeX 2.6\miktex\bin;C:\Program Files\pstoedit;C:\Program Files\gs\gs8.60\bin;C:\Program Files\gs\fonts on th path
The error I get is:

Code: Select all

Traceback (most recent call last):

  File "C:\Program Files\Inkscape\share\extensions\eqtexsvg.py", line 138, in <module>

    e.affect()

  File "C:\Program Files\Inkscape\share\extensions\inkex.py", line 154, in affect

    self.effect()

  File "C:\Program Files\Inkscape\share\extensions\eqtexsvg.py", line 133, in effect

    svg_open(self, svg_file)

  File "C:\Program Files\Inkscape\share\extensions\eqtexsvg.py", line 69, in svg_open

    doc = inkex.etree.parse(filename)

  File "etree.pyx", line 1845, in etree.parse

  File "parser.pxi", line 928, in etree._parseDocument

  File "parser.pxi", line 932, in etree._parseDocumentFromURL

  File "parser.pxi", line 849, in etree._parseDocFromFile

  File "parser.pxi", line 557, in etree._BaseParser._parseDocFromFile

  File "parser.pxi", line 631, in etree._handleParseResult

  File "parser.pxi", line 602, in etree._raiseParseError

etree.XMLSyntaxError: line 1: Start tag expected, '<' not found



After repeating what sas instructed, I get

Code: Select all

05/04/2008  12:20 PM    <DIR>          .
05/04/2008  12:20 PM    <DIR>          ..
05/04/2008  12:20 PM               262 eq.tex
05/04/2008  12:20 PM               482 eq.out
05/04/2008  12:20 PM             4,668 eq.log
05/04/2008  12:20 PM                 9 eq.aux
05/04/2008  12:20 PM               600 eq.dvi
05/04/2008  12:20 PM            30,384 eq.ps
05/04/2008  12:20 PM                 0 eq.err
05/04/2008  12:20 PM                 0 eq.svg
               8 File(s)         36,405 bytes
               2 Dir(s)   7,674,724,352 bytes free


and for eq.out

Code: Select all

C:\DOCUME~1\Nada\LOCALS~1\Temp\inkscape-ezlcg9>type  eq.out
pstoedit: version 3.45 / DLL interface 108 (build Sep 10 2007 - release build -
MS VC++ 1300) : Copyright (C) 1993 - 2007 Wolfgang Glunz
Can't load C:\Ghostgum\gs0.0\bin\gsdll32.dll
PostScript/PDF Interpreter finished. Return status -1 executed command : C:\Ghos
tgum\gs0.0\bin\gsdll32.dll -IC:\Ghostgum\gs0.0;C:\Ghostgum\gs0.0\fonts -q -dDELA
YBIND -dWRITESYSTEMDICT -dNODISPLAY -dNOEPS C:/DOCUME~1/Nada/LOCALS~1/Temp/psin4

The interpreter seems to have failed, cannot proceed !


Any help will be appreciated!


Return to “Help with using Inkscape”