1

I'm seeing the following error in Sublime Text 3 (on Windows 7) when my cursor is inside an equation:

enter image description here

When I click on "Show Report", a file is opened that contains 1 line

 Failed to convert pdf to png to preview.

When I click on "Check System", a file is opened that contains the the following:

 Program    Location                                             Status     Version
 -------    --------                                             ------     -------
 sublime    C:\Program Files\Sublime Text 3\sublime_text.exe     available  Sublime Text Build 3126
 ...
 gswin32c   None                                                 missing    unavailable

Is there a way to get this working? Or even just disable this feature? I don't care whether the equation is previewed or not.

Any help is greatly appreciated.

2

Well, I figured out how to disable this feature.

Navigate to:

Preferences->Package Settings->LaTeXTools->Settings - User

Insert the following line, save the file and restart Sublime:

"preview_math_mode": "none",
  • Is there any way to access these settings on a Mac? I don't see any file paths like this. Probably they are being hidden somehow by the operating system. – Dan Ramras Apr 27 '18 at 17:58
2

Just to provide the other alternative, the snippet of your system check seems to show that you don't have Ghostscript installed, which is necessary for the equation preview to work. There are some detailed instructions in the README on how to setup the equation preview, but, in brief, you need to:

  1. Install ImageMagick
  2. Install Ghostscript
  3. Ensure both of these are available either on your system PATH or in the path specified as your texpath setting.
2

This Math Preview problem is what I just encountered these days, and I fixed it following the instructions in Error: Failed to run 'pdflatex' to create pdf to preview enter image description here

I can rewrite the fixing process here with more details.

  1. Running the "Show Report", and you will get the log file. It should be like this enter image description here
  2. Copy the content in the red box, and paste them into a new tex file, and run it. You will encounter a package missing problem. If you use the Miktex, then the miktex will tell you missing some particular packages. As for my case, I miss the luatex85 package.

    tex\generic\luatex85\luatex85.sty enter image description here

  3. Install the luatex package or other missing packages in Miktex package manager. enter image description here
  4. Now, we are good! enter image description here
  5. Some additional tips The default size setting of the math preview is kind of small, you can enlarge it by increasing preview_math_density in the setting file, like from 150 (default) to 200. enter image description here
1

I had this problem and it turned out the ghostscript bundled with MacTex interfered with the one installed with brew. By looking in the Sublime Text console I could copy the exact ghostscript command being run, then I ran it in a regular terminal and got a better error message: GPL Ghostscript 9.23: Can't find initialization file gs_init.ps. The solution was to force-link ghostscript (after installing it via brew if you haven't yet) so basically:

brew install ghostscript
brew link --overwrite ghostscript
  • Welcome to TeX.SX! Please don't just link to an external resource but rather copy the relevant information to your answer. (A link to the source ist still good.) This way people can see the whole solution here and, more importantly, the answer is self-contained, i.e. not reliant on links that may break. – schtandard Sep 23 at 15:57
  • @schtandard Thanks, I've updated the answer with the relevant info and improved it a bit overall. – Markus Amalthea Magnuson Sep 23 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.