SublimeText / LaTeXTools

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

could not compile if the article file is opened via command line #971

Open Mark-Han opened 7 years ago

Mark-Han commented 7 years ago

If I open the .tex file from the command line by typing subl articlefile.tex, the compilation can't be done. The message in the ST console is shown as below.

<class '_latextools_basicBuilder.BasicBuilder'>
6
Welcome to thread Thread-16
['pdflatex', '-interaction=nonstopmode', '-synctex=1', 'articlefile']
Running "'' -interaction=nonstopmode -synctex=1 articlefile"
Traceback (most recent call last):
  File "C:\Users\DELL\AppData\Roaming\Sublime Text 3\Packages\LaTeXTools\makePDF.py", line 293, in run
    cwd=self.caller.tex_dir
  File "C:\Users\DELL\AppData\Roaming\Sublime Text 3\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] 句柄无效。(these Chinese characters mean invalid handle)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\DELL\AppData\Roaming\Sublime Text 3\Packages\LaTeXTools\makePDF.py", line 299, in run
    self.caller.output(" ".join(cmd))
TypeError: sequence item 0: expected str instance, NoneType found

It works very well if the file is directly opened in files manager. The ST3 program and LaTeXTools package are both the most recent version. I am working on Win7 SP1.

ig0774 commented 7 years ago

It looks like you're using v3.12.7 instead of v3.12.8, as this was a bug fixed in the latest version. That said, this only happens if pdflatex can't be found on your system PATH or via the texpath setting in LaTeXTools. Do you have a LaTeX distribution installed?

Mark-Han commented 7 years ago

Thanks for your reply, @ig0774 . I'm terribly sorry that I can't affirm the exact version of LaTeXTooLs when raising the issue, the version of the LaTeXTools is v3.12.8 in the flowing picture. I do have a LaTeX distribution (MiKTeX 2.9) installed on my computer (Win7). However, it still does not work, and I have upgraded it to v3.12.11 now. Unfortunately, the article file can not be compiled if opened via command line as before.

ask

The message in the console goes like this:

Welcome to thread Thread-8
['pdflatex', '-interaction=nonstopmode', '-synctex=1', 'articlefile']
Running "'C:\Program Files\MiKTeX 2.9\miktex\bin\pdflatex.EXE' -interaction=nonstopmode -synctex=1 articlefile"
Traceback (most recent call last):
  File "C:\Users\DELL\AppData\Roaming\Sublime Text 3\Packages\LaTeXTools\makePDF.py", line 293, in run
    cwd=self.caller.tex_dir
  File "C:\Users\DELL\AppData\Roaming\Sublime Text 3\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] 句柄无效。