SublimeText / LaTeXTools

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

COULD NOT COMPILE (ST3, Windows 64bit and MikTex) #355

Open rogah opened 10 years ago

rogah commented 10 years ago

Since the latest update the build (Ctrl+B) is failing with the following:

TraditionalBuilder: Invoking texify... 

COULD NOT COMPILE!

Attempted command:texify -b -p --tex-option="--synctex=1" filename.tex
Build engine: Traditional Builder

I have followed the instructions to issue the command from the command palette "Reconfigure and migrate settings".

I'm using the default generated LaTeXTools.sublime-settings with the following:

    "windows": {
        // Path to tex & friends. "" is fine for MiKTeX
        // For TeXlive 2011 (or other years) use
        // "texpath" : "C:\\texlive\\2011\\bin\\win32;$PATH",
        "texpath" : "",
        // TeX distro: "miktex" or "texlive"
        "distro" : "miktex"
    },

The PATH variable contains both the path to MixText bin folder (C:\Program Files\MiKTeX 2.9\miktex\bin\x64) and the path to SumatraPDF (C:\Program Files (x86)\SumatraPDF).

If I issue the same texify command plus the sumatrapdf from within the prompt command-line (cmd.exe) it works.

C:\> texify -b -p --tex-option="--synctex=1" filename.tex && sumatrapdf filename.pdf
msiniscalchi commented 10 years ago

Can you try explicitly adding $PATH to "texpath"?

On Thu, Mar 13, 2014 at 10:08 PM, Rogério W. Carvalho < notifications@github.com> wrote:

Since the latest update the build (Ctrl+B) is failing with the following:

TraditionalBuilder: Invoking texify...

COULD NOT COMPILE!

Attempted command:texify -b -p --tex-option="--synctex=1" filename.tex Build engine: Traditional Builder

I have followed the instructions to issue the command from the command palette "Reconfigure and migrate settings".

I'm using the default generated LaTeXTools.sublime-settings with the following:

"windows": {
    // Path to tex & friends. "" is fine for MiKTeX
    // For TeXlive 2011 (or other years) use
    // "texpath" : "C:\\texlive\\2011\\bin\\win32;$PATH",
    "texpath" : "",
    // TeX distro: "miktex" or "texlive"
    "distro" : "miktex"
},

The PATH variable contains both the path to MixText bin folder (C:\Program Files\MiKTeX 2.9\miktex\bin\x64) and the path to SumatraPDF(C:\Program Files (x86)\SumatraPDF).

If I issue the same texify command plus the sumatrapdf from within the prompt command-line (cmd.exe) it works.

C:> texify -b -p --tex-option="--synctex=1" filename.tex && sumatrapdf filename.pdf

Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/355 .

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661

msiniscalchi commented 10 years ago

Actually, I just tried on a setup identical to yours... and everything works. (Win8.1x64+MikTeX is the setup of one of my work machines). No need to change "texpath" at all... Not sure what might be going on.

rogah commented 10 years ago

I guess the only difference is that I'm running on a Win 7x64. I'll give it another try and let you know...

ghost commented 10 years ago

I am also having this problem, what was the solution?

Similarly I just autoupdated, ran "Reconfigure and migrate settings" and now get the same error as OP.

ghost commented 10 years ago

Ok I found the solution, for me at least.

Apparently it's not enough to run the reconfigure command, because the update also reset the settings file. Go to Data\Packages\User\LaTeXTools.sublime-settings and punch in path to miktex/texlive distro, then it works again.

msiniscalchi commented 10 years ago

OK, good. I do think it's a misconfiguration issue though, because MikTeX should set the path upon installation. Anyway, the texpath option is there for a reason :-) Do check the README for details. On Mar 27, 2014 4:06 PM, "Fnantier" notifications@github.com wrote:

Ok I found the solution, for me at least.

Apparently it's not enough to run the reconfigure command, because the update also reset the settings file. Go to Data\Packages\User\LaTeXTools.sublime-settings and punch in path to miktex/texlive distro, then it works again.

Reply to this email directly or view it on GitHubhttps://github.com/SublimeText/LaTeXTools/issues/355#issuecomment-38860652 .

ghost commented 10 years ago

Well I did set texlive bin/32 path upon initial installation long ago, it just basically reset the settings file so I had to provide the texlive distro path again, so it's clearly a side-effect of the update. Not so elegantly done not informing the user imo.

Still grateful for the free work someone is doing for us and it does feel a bit faster actually :)

WilliamQLiu commented 9 years ago

I ran into the same issue right after installing the package (on a Win7, 64bit machine) and running the reconfigure command. A simple restart of Sublime Text fixed the issue (at least for me).

498143049 commented 8 years ago

I am also having the same problem, then I restart my computer , The problem is sloved。

ig0774 commented 8 years ago

@498143049: that may actually be a different problem... When you get the COULD NOT COMPILE error message, it is helpful to have the output from the console (View|Show Console in the menu bar) otherwise, we have little idea what's going on.

pranavsubramani commented 7 years ago

The error is because you Texlive is not in the path, if you look at the settings-user file in Sublime, it'll show what compiler you're using (default was MikTex for me), swapped it for texlive and added texlive to the path and it compiled properly. I think this is a fix for the problem, it can be closed.

Ionizing commented 7 years ago

I am confused that my $PATH includes my TeX programs like:

$ echo $PATH /home/ionizing/.nvm/versions/node/v8.1.2/bin:/usr/bin/site_perl:/home/ionizing/anaconda3/bin:/home/ionizing/perl5/bin:/usr/lib/hardening-wrapper/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/local/texlive/2017/bin/x86_64-linux/

and the texpath in LaTeXTools.sublime.settings says: "texpath" : "$PATH:/usr/bin", which means my TeX programs are ALREADY in "texpath". I cannot understand why doesn't the compiler work.

And actually, I replaced "texpath" : "$PATH:/usr/bin" with "texpath" : "$PATH:/usr/local/texlive/2017/bin/x86_64-linux/" (I just installed texlive 2017), everything works well.

ig0774 commented 7 years ago

On Linux the $PATH seen by LaTeXTools can differ from the path in your shell if the shell $PATH variable is modified in .bashrc, .bash_profile or other shell-specific configuration files. This is because the window manager is spawned from a plain sh instance, so when ST is launched by the window manager it inherits a stripped-down path. You can see the $PATH LaTeXTools uses in the output from the LaTeXTools: Check System command.

The latest dev build of ST3 imports the $PATH from the login shell which should fix this.

Ionizing commented 7 years ago

@ig0774 Thank you very much.

hustzxd commented 6 years ago

I met the same problem. And I solved it by setting "distro" : "texlive".

    "windows": {
        // Path used when invoking tex & friends; "" is fine for MiKTeX
        // For TeXlive 2011 (or other years) use
        // "texpath" : "C:\\texlive\\2011\\bin\\win32;$PATH",
        "texpath" : "C:\\softwares\\texlive\\2017\\bin\\win32;$PATH",
        // TeX distro: "miktex" or "texlive"
        "distro" : "texlive", // !!!!!!!!
        // Command to invoke Sumatra. If blank, "SumatraPDF.exe" is used (it has to be on your PATH)
        "sumatra": "",
        // Command to invoke Sublime Text. Used if the keep_focus toggle is true.
        // If blank, "subl.exe" or "sublime_text.exe" will be used.
        "sublime_executable": "",
        // how long (in seconds) to wait after the jump_to_pdf command completes
        // before switching focus back to Sublime Text. This may need to be
        // adjusted depending on your machine and configuration.
        "keep_focus_delay": 0.5
    },