szhorvat / MaTeX

LaTeX labels in Mathematica
http://szhorvat.net/mathematica/MaTeX
MIT License
375 stars 45 forks source link

Trouble using Matex on windows 10 professional, Mathematica 11.3 64 bit. Unable to find Ghostscript #23

Closed nasser1 closed 5 years ago

nasser1 commented 5 years ago

Hello; I installed Matex 1.7.4 using Paclet OK. Installed GhostScript 9.26 the 64 bit from https://www.ghostscript.com/download/gsdnld.html OK. It installs to "C:\Program Files\gs\gs9.26\bin"

where it shows the content as gswin64c.exe, gswin64.exe, gsdll64.lib, gsdll64.dll

I also added the path "C:\Program Files\gs\gs9.26\bin" to my windows 10 environment variables just in case.

I also did the ConfigureMaTeX["Ghostscript" -> "C:\\Program Files\\gs\\gs9.26\\bin"] in a notebook after starting Matex.

Yet, Matex keeps giving the error that it can't find Ghostscript.

Ghostscript is not found at C:\Program Files\gs\gs9.26\bin

But it is there:

C:\>dir "C:\Program Files\gs\gs9.26\bin"
 Directory of C:\Program Files\gs\gs9.26\bin

01/13/2019  09:29 PM    <DIR>          .
01/13/2019  09:29 PM    <DIR>          ..
11/20/2018  05:33 AM        18,789,888 gsdll64.dll
11/20/2018  05:33 AM             8,002 gsdll64.lib
11/20/2018  05:33 AM           173,056 gswin64.exe
11/20/2018  05:33 AM           164,352 gswin64c.exe
               4 File(s)     19,135,298 bytes
               2 Dir(s)  791,972,179,968 bytes free

So I am not sure what is the problem and what to try. Any suggestions?

Thanks --Nasser

szhorvat commented 5 years ago

You need to provide the path to gswin64c.exe, not the directory containing it. So it should be

ConfigureMaTeX["Ghostscript" -> "C:\\Program Files\\gs\\gs9.26\\bin\\gswin64c.exe"]

or similar depending on the Ghostscript installation path. It is not necessary to add Ghostscript to the system path.

However, MaTeX can generally detect Ghostscript on Windows. To re-run detection, use

MaTeX`Developer`ResetConfiguration[]

Warning: This will reset all settings (including the pdflatex path)