SublimeText / LaTeXTools

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

LatexTools not working on windows #1470

Open brupelo opened 4 years ago

brupelo commented 4 years ago

Hello, newbie user here and trying to get started but I'm having some issues. Here's the steps I've followed:

Variable   Value
--------   -----
PATH       ...other paths...;d:\software\miktex\miktex29\miktex\bin\x64\
TEXINPUTS  None 
BIBINPUTS  None 
BSTINPUTS  None 

Program      Location  Status   Version
-------      --------  ------   -------
sublime                missing  unavailable
texify                 missing  unavailable
pdflatex               missing  unavailable
xelatex                missing  unavailable
lualatex               missing  unavailable
biber                  missing  unavailable
bibtex                 missing  unavailable
bibtex8                missing  unavailable
kpsewhich              missing  unavailable
magick                 missing  unavailable
ghostscript            missing  unavailable

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

Builder      Status
-------      ------
traditional  available

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

Viewer   Status     Location
------   ------     --------
sumatra  available  d:\software\miktex\miktex29\miktex\bin\x64\SumatraPDF.exe
$ where sublime                                                            
INFO: Could not find files for the given pattern(s).                          
$ where sublime_text                                                       
D:\sources\personal\sublimetext3\sublime_text.exe                          
$ where texify                                                             
d:\software\miktex\miktex29\miktex\bin\x64\texify.exe                         
$ where pdflatex                                                           
d:\software\miktex\miktex29\miktex\bin\x64\pdflatex.exe                    
$ where xelatex                                                            
d:\software\miktex\miktex29\miktex\bin\x64\xelatex.exe                        
$ where lualatex                                                           
d:\software\miktex\miktex29\miktex\bin\x64\lualatex.exe                    
$ where biber                                                              
d:\software\miktex\miktex29\miktex\bin\x64\biber.exe                       
$ where bibtex                                                             
d:\software\miktex\miktex29\miktex\bin\x64\bibtex.exe                      
$ where bibtex8                                                            
d:\software\miktex\miktex29\miktex\bin\x64\bibtex8.exe                     
$ where kpsewhich                                                          
d:\software\miktex\miktex29\miktex\bin\x64\kpsewhich.exe                   
$ where magick                                                             
INFO: Could not find files for the given pattern(s).                       
$ where ghostscript                                                        
INFO: Could not find files for the given pattern(s).                       
$ where standalone                                                         
INFO: Could not find files for the given pattern(s).                       
$ where preview                                                            
INFO: Could not find files for the given pattern(s).                       
$ where xcolor                                                             
INFO: Could not find files for the given pattern(s).                       
$ where amsmath                                                            
INFO: Could not find files for the given pattern(s).                       
$ where amssymb                                                            
INFO: Could not find files for the given pattern(s).                       
$ where latexsym                                                           
INFO: Could not find files for the given pattern(s).                       
$ where mathtools                                                          
INFO: Could not find files for the given pattern(s).                       

Unfortunately that didn't work and if I try to compile a simple tex such as:

\documentclass[a4paper]{article}
\begin{document}
Hello xxx!werwer
\end{document}

Using LaTex build system I'll get:

TraditionalBuilder: Engine: pdflatex. Invoking texify... 

COULD NOT COMPILE!

Attempted command:d:\software\miktex\miktex29\miktex\bin\x64\texify.EXE -b -p --engine=pdftex --tex-option="--synctex=1" texto-1.tex
Build engine: Traditional Builder

With the console error:

>>> 
<class '_latextools_traditionalBuilder.TraditionalBuilder'>
8
Welcome to thread Thread-344
Running "'d:\software\miktex\miktex29\miktex\bin\x64\texify.EXE' -b -p --engine=pdftex '--tex-option="--synctex=1"' texto-1.tex"
Traceback (most recent call last):
  File "D:\sources\personal\sublimetext3\Data\Packages\LaTeXTools\makePDF.py", line 317, in run
    cwd=self.caller.tex_dir
  File "D:\sources\personal\sublimetext3\Data\Packages\LaTeXTools\latextools_utils\external_command.py", line 221, in external_command
    cwd=cwd
  File "./python3.3/subprocess.py", line 784, in __init__
  File "./python3.3/subprocess.py", line 980, in _get_handles
  File "./python3.3/subprocess.py", line 1030, in _make_inheritable
OSError: [WinError 6] The handle is invalid

I've read on the internet everybody saying wonderful things about this package and I'd love to give it a shot but so far the initial experience has been really painful :crying_cat_face: ... So, could you please advice? Is this a bug or it's just me being clumsy?

r-stein commented 4 years ago

Have you tried to restart sublime text or your PC? Obviously this should not happen, but it is hard to see what's the problem from the error message.

brupelo commented 4 years ago

@r-stein About restarting sublime text, yeah, definitely (few times while debuggin)... in fact, i've uninstalled/installed the package (removed completely all the remaining settings) as well.

Also, few hours ago I've opened this https://forum.sublimetext.com/t/lightweight-workflow-to-edit-preview-latex-docs-in-st3/50149/7... in there you'll find some additional info related to this one... I've stoped debugging as I didn't know the cause of the traceback i was seeing (you can see the traceback in that thread).

That said, gonna restart the PC... that's something I didn't do yet :) . Tbh, I'd love to give it a shot to this package so I can stop using TexStudio et al

ig0774 commented 4 years ago

The other suggestion would be to try the basic builder (ctrl + shift + b should let you change the builder). TeXify is the default builder when using MiKTeX on Windows, but that’s largely for historical reasons. TeXify doesn’t tend to provide helpful output (there’s a logging file somewhere; I don’t remember where exactly, but it seems like you might be running into some other issue).

If that doesn’t work, try running the command you see in the output in a CMD or Powershell window. That may give a better clue as to what is going on.

brupelo commented 4 years ago

After a lot of researching I've figured out how to reproduce this bug quite easily.

Make sure to spawn sublime_text from the terminal, that way the package will be broken completely. Why? Because the current version it's assuming SublimeText is always spawned "normally" (ie: as a explorer.exe subprocess child on windows instead cmd's one)... Ideally the package should run normally no matter how sublime text has been spawned though.

Finally I'm testing the package and it's pretty awesome actually... Offtopic, when I'm not working on a latex document, the package won't be consuming any resources in the background, right?

r-stein commented 4 years ago

Thanks for reproducing this. If you have no latex document open should not consume additional resources. However currently every start time from sublime text is delayed a little bit until it is fully loaded, because this a rather big package and we have some mechanism during the package loading. We are planing to move to a lazy load mechanism, but it does not yet exists.