[Tex/LaTex] latex preview in emacs unable to run ghostscript

auctexemacsghostscript

So, on Windows 8, emacs, trying to use preview-latex. Each time I get the same error:

Preview-PDF2DSC finished at Mon Oct 13 12:55:42
PDF2DSC sentinel: Searching for program: permission denied, GSWIN32C.EXE

I'm new to both latex and emacs, Googling around I can't find anyone with a similar error. Most of the ideas I've tried from that are unlikely things like checking the permissions on the gs folder in Program Files. Any ideas?

EDIT: Everything compiles; I can for example get it to give me a pdf of the tex with C-c C-c. Also, if I try to get a preview, the log includes the following

Output written on _region_.pdf (1 page, 42052 bytes).
Transcript written on _region_.log.
Preview-LaTeX exited as expected with code 1 at Mon Oct 13 15:48:49
Running `Preview-PDF2DSC' with ``pdf2dsc "_region_".pdf "_region_.prv/tmp4804YjF"/preview.dsc''

If I go open _region_.pdf it contains the compiled math as it should. The log immediately above is then immediately followed by the error message I posted originally.

emacs and auctex were set up using the installation wizard from this source http://vgoulet.act.ulaval.ca/en/emacs/windows/

I installed gs 9.15 and gswin32c.exe is a folder listed in PATH. I can view the various examples that the installation includes.

Also, it's Windows 8, not 8.1.

Best Answer

lawlist's second suggestion (in comments above) ended up being correct. I will document exactly what I did here for anyone that ends up with the same problem.

To troubleshoot, I cut and pasted the gs folder out of Program Files to see what would happen. Got the same error message. So I figured emacs was not using the path I had hoped I provided it (I repeat that the correct path was in the PATH environment variable all along).

lawlist in the comment suggested that I check the path emacs was using for ghostscript. Perhaps it's because I'm so new to emacs and did something wrong without realizing but the commands he mentions did not work for me (emacs returns [no match]). But I was able to find the path being used with the following:

Preview dropdown menu -> customize -> Browse options

Select Preview Gs.

Preview Gs Command was set to GSWIN32C.EXE. I replaced this with the full path where GSWIN32C.EXE is located. Now preview works.

Thanks to lawlist and Keks Dose for the help!