SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2.01k stars 364 forks source link

Math preview not working but everything seems fine #1405

Closed NeoFantom closed 5 years ago

NeoFantom commented 5 years ago

Math preview isn't working. As this picture shows:

image

When I run check system, everything is OK:

Program      Location                                           Status     Version
-------      --------                                           ------     -------
sublime      D:\Program Files\Sublime Text 3\sublime_text.exe   available  Sublime Text Build 3207
latexmk      D:\texlive\2018\bin\win32\latexmk.exe              available  Latexmk, John Collins, 25 October 2018. Version 4.61
pdflatex     D:\texlive\2018\bin\win32\pdflatex.exe             available  pdfTeX 3.14159265-2.6-1.40.19 (TeX Live 2018/W32TeX)
xelatex      D:\texlive\2018\bin\win32\xelatex.exe              available  XeTeX 3.14159265-2.6-0.99999 (TeX Live 2018/W32TeX)
lualatex     D:\texlive\2018\bin\win32\lualatex.exe             available  This is LuaTeX, Version 1.07.0 (TeX Live 2018/W32TeX)
biber        D:\texlive\2018\bin\win32\biber.exe                available  biber version: 2.12
bibtex       D:\texlive\2018\bin\win32\bibtex.exe               available  BibTeX 0.99d (TeX Live 2018/W32TeX)
bibtex8      D:\texlive\2018\bin\win32\bibtex8.exe              available  This is 8-bit Big BibTeX version 0.99d
kpsewhich    D:\texlive\2018\bin\win32\kpsewhich.exe            available  kpathsea version 6.3.0
magick       D:\Program Files\ImageMagick-7.0.8-Q16\magick.exe  available  ImageMagick 7.0.8-40 Q16 x64 2019-04-13 http://www.imagemagick.org
ghostscript  D:\texlive\2018\tlpkg\tlgs\bin\gswin32c.exe        available  GPL Ghostscript 9.26 (2018-11-20)

Packages for equation preview  Status
-----------------------------  ------
standalone                     available
preview                        available
xcolor                         available
amsmath                        available
amssymb                        available
latexsym                       available
mathtools                      available

Builder  Status
-------  ------
basic    available

Builder Setting  Value
---------------  -----
display_log      False
linux            {}   
osx              {}   
windows          {}   

TeX Root
--------
D:\All\Graduating Paper\Math\HuiqiXue-Math\chapters\chap02.tex

LaTeX Engine
------------
pdflatex    

Viewer   Status     Location
------   ------     --------
sumatra  available  C:\Program Files\SumatraPDF\SumatraPDF.exe

When I run show report, it shows only one line:

Failed to convert pdf to png to preview.

What is the problem?

r-stein commented 5 years ago

The expected behavior is that if the compilation fails the the error message should be "Failed to run pdflatex to create pdf to preview" and the report should contain the latex file and the whole compilation log. I am not sure why your error occurs. It might be the case that it the compilation created a broken oder empty pdf.

NeoFantom commented 5 years ago

The expected behavior is that if the compilation fails the the error message should be "Failed to run pdflatex to create pdf to preview" and the report should contain the latex file and the whole compilation log. I am not sure why your error occurs. It might be the case that it the compilation created a broken oder empty pdf.

How can I clean up the temp files created for compilation?

ig0774 commented 5 years ago

They’re deleted automatically. No intervention is required (we only keep the generated PNGs.

Are you using the preview build? I think it has better handling for this situation.

NeoFantom commented 5 years ago

They’re deleted automatically. No intervention is required (we only keep the generated PNGs.

Are you using the preview build? I think it has better handling for this situation.

I'm using sublime 3.2.1, the latex stable version. Are u suggesting me to use the preview version of Sublime Text?

ig0774 commented 5 years ago

No not a preview version of ST, but of the LaTeXTools package. Basically, this issue seems to be a duplicate of #1148. In particular, for TeXLive 2017 on Windows the bundled Ghostscript version doesn't work. The easiest solution is to just install Ghostscript either via the installer there or Chocolatey. However, if you use the preview version of LaTeXTools, which may be unstable, this issue should be fixed there.

NeoFantom commented 5 years ago

No not a preview version of ST, but of the LaTeXTools package. Basically, this issue seems to be a duplicate of #1148. In particular, for TeXLive 2017 on Windows the bundled Ghostscript version doesn't work. The easiest solution is to just install Ghostscript either via the installer there or Chocolatey. However, if you use the preview version of LaTeXTools, which may be unstable, this issue should be fixed there.

I do have the standalone Ghostscript installed on my PC and the path variable is set. But latexTools check system still shows only the builtin version of gs in latex. How to cope with that?

ig0774 commented 5 years ago

You can see the PATH variable as LaTeXTools sees it by running the Check System command. This, in turn, is controlled by the "texpath" setting which, by default, is blank on Windows, but if you've set it to a non-blank, should have $PATH or %PATH% in it somewhere.