Author Topic: Viewing LaTex strings in WinFIG  (Read 16597 times)

ayoungzz9

  • Newbie
  • *
  • Posts: 1
    • View Profile
Viewing LaTex strings in WinFIG
« on: August 23, 2007, 03:18:02 PM »
When I set the SPECIAL button of a text object and enable the LaTex preview WinFIG causes an error and the program exists.  The logfile contains the error
"unknown device: pngalpha".  This refers to a GhostScript device and I ensured that I have a correct version of GhostScript installed on my computer.

Any suggestions how to get rid of this problem?

Thanks
Andre

Andreas

  • Administrator
  • Full Member
  • *****
  • Posts: 140
    • View Profile
Re: Viewing LaTex strings in WinFIG
« Reply #1 on: August 23, 2007, 05:19:35 PM »
Probably there is really a problem with the GhostScript version. Can you use regedit to check the registry for the installed versions?

You find GhostScrpt under:
HKEY_LOCAL_MACHINE\SOFTWARE\AFPL Ghostscript

Also, WinFIG shows a remark in the "about"-box regarding the version it will call for such operations.
This forum belongs to www.schmidt-web-berlin.de/winfig

simplex

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Viewing LaTex strings in WinFIG
« Reply #2 on: August 30, 2007, 09:22:18 PM »
I have a problem with WinFIG crashing when I use "special" strings too. Looking at the log file I see:
C:\WinFIG\"\gswin32c.exe" -q -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pngalpha -r96 -dEPSCrop -sOutputFile="C:\Temp\texclip.png" "C:\Temp\texclip.eps" failed with error code 123
This line is not syntactically correct for execution at the command prompt (in XP) -- the portion "\gswin32c.exe" needs to have the backslash removed: "gswin32c.exe"
I believe this is the cause for my error. Is there a way I can reconfigure winFIG to effect this change?

Thanks,
Manuel

Andreas

  • Administrator
  • Full Member
  • *****
  • Posts: 140
    • View Profile
Re: Viewing LaTex strings in WinFIG
« Reply #3 on: August 31, 2007, 12:17:51 AM »
Actually, the line should look like this:
"C:\Program Files\gs\gs8.53\bin\\gswin32c.exe" -q -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pngalpha -r96 -dEPSCrop -sOutputFile="C:\temp\texclip.png" "C:\temp\texclip.eps"

This ist the template that is being used:
\"%s\\gswin32c.exe\" -q -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pngalpha -r%d -dEPSCrop -sOutputFile=\"%s\" \"%s\"

The first %s is replaced by the path to the GhostScript executable. This is the thing to check first. Is GhostScript installed and where? Is it configured in the registry under "HKEY_LOCAL_MACHINE\SOFTWARE\AFPL Ghostscript"?

I'm also wondering why  it's
C:\WinFIG\"\gswin32c.exe"
and not
"C:\WinFIG\\gswin32c.exe"
This forum belongs to www.schmidt-web-berlin.de/winfig

simplex

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Viewing LaTex strings in WinFIG
« Reply #4 on: August 31, 2007, 01:30:57 AM »
Ah, I fixed it! Thanks for pointing me to that registry key, and the fact that you're using AFPL 8.53. You see, I have the version GPL Ghostscript 8.60, which creates the key
HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\8.60
and puts the strings GS_DLL and GS_BIN there. So all I had to do was create a new dummy key
HKEY_LOCAL_MACHINE\SOFTWARE\AFPL Ghostscript\8.53
and copy those strings over. You should add to the notes on your web page that users should use the correct version of GS, or else have WinFIG search for these different possible keys.

BTW Very handy software--my papers I have to write will look much better and get done much faster now! Thanks!

Andreas

  • Administrator
  • Full Member
  • *****
  • Posts: 140
    • View Profile
Re: Viewing LaTex strings in WinFIG
« Reply #5 on: August 31, 2007, 04:54:08 PM »
You can even change the version number in your dummy key to 8.60.

Because WinFIG actually scans
HKEY_LOCAL_MACHINE\SOFTWARE\AFPL Ghostscript
for any sub-keys and subsequently queries the first that it can find for the GS_DLL value.

Example:
If it finds "8.53" under
HKEY_LOCAL_MACHINE\SOFTWARE\AFPL Ghostscript
it would next query
HKEY_LOCAL_MACHINE\SOFTWARE\AFPL Ghostscript\8.53\GS_DLL

Therefore it should work with any GhostScript version that creates a registry entry according to
HKEY_LOCAL_MACHINE\SOFTWARE\AFPL Ghostscript\xxx\GS_DLL

I think the best is to implement another search for
HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript
in case "AFPL Ghostscript" was not found.
« Last Edit: August 31, 2007, 04:55:56 PM by Andreas »
This forum belongs to www.schmidt-web-berlin.de/winfig

mcguyton

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Viewing LaTex strings in WinFIG
« Reply #6 on: October 04, 2007, 01:37:13 AM »
I have GPL Ghostscript 8.50 installed via Cygwin.

From reading your discussion, it seems I have to add strings in the registry named:
HKEY_LOCAL_MACHINE\SOFTWARE\AFPL Ghostscript\8.50\GS_DLL
HKEY_LOCAL_MACHINE\SOFTWARE\AFPL Ghostscript\8.50\GS_BIN

What do I put in those strings?
My Ghostscript executable is at: C:\Cygwin\Bin\gs.exe

I have nothing in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript

Thank you.

mcguyton

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Viewing LaTex strings in WinFIG
« Reply #7 on: October 04, 2007, 03:10:34 AM »
I tried copying c:\cygwin\bin\gs.exe to the winfig directory and putting "." in the string at HKEY_LOCAL_MACHINE\SOFTWARE\AFPL Ghostscript\8.50\GS_DLL.  Now WinFIG no longer crashes when I look at Libraries that contain figs with Latex code.  However, the latex text doesn't show up and I get an error message from WinFIG.  The winfig.log file is attached.  Any ideas on how I should get this to work?  Thanks.

Andreas

  • Administrator
  • Full Member
  • *****
  • Posts: 140
    • View Profile
Re: Viewing LaTex strings in WinFIG
« Reply #8 on: October 05, 2007, 03:48:11 PM »
From reading your discussion, it seems I have to add strings in the registry named:
HKEY_LOCAL_MACHINE\SOFTWARE\AFPL Ghostscript\8.50\GS_DLL
HKEY_LOCAL_MACHINE\SOFTWARE\AFPL Ghostscript\8.50\GS_BIN

The first is enough.

Quote
What do I put in those strings?
My Ghostscript executable is at: C:\Cygwin\Bin\gs.exe

Then put  C:\Cygwin\Bin

Perhaps you also install an AFLP GhostScript version 8.53. Your version 8.5 is a bit outdated, but this is not the problem here.

Quote
The winfig.log file is attached.  Any ideas on how I should get this to work?

The log file contains:
/usr/bin/dvips: ! DVI file can't be opened.

This tells me that LaTeX did not produce a DVI file. What version of LaTeX are you using? I tested with MiKTeX. Try to configure the commands in the preferences to work with your LaTeX.

If the problem persists, you can still deactivate the TeX preview in the preferences. I think I will make this the default in the next release.
« Last Edit: November 18, 2010, 11:22:10 PM by Andreas »
This forum belongs to www.schmidt-web-berlin.de/winfig