James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.71k stars 533 forks source link

Keeps on loading #1049

Closed atropos112 closed 5 years ago

atropos112 commented 5 years ago

Hi I just downloaded Latex Workshop and trying to compile very simple latex document :

\documentclass[11pt]{article} \begin{document} Hello \end{document}

these are the logs:

[18:26:20] Initializing LaTeX Workshop. [18:26:21] Creating LaTeX Workshop http and websocket server. [18:26:21] LaTeX Workshop initialized. [18:26:21] Found root file from active editor: c:\Users\jackk\Desktop\Latex\Test\test.tex [18:26:22] Root file changed from: undefined. Find all dependencies. [18:26:22] Instatiating new file watcher for c:\Users\jackk\Desktop\Latex\Test\test.tex [18:26:22] Parsing c:\Users\jackk\Desktop\Latex\Test\test.tex [18:26:22] Server created on 127.0.0.1:51379 [18:26:22] Snippet data loaded. [18:26:22] LaTeX Workshop version: 5.17.3 [18:26:28] ACTIONS command invoked. [18:26:32] LOG command invoked. [18:26:35] ACTIONS command invoked. [18:26:38] RECIPES command invoked. [18:26:41] BUILD command invoked. [18:26:41] Found root file from active editor: c:\Users\jackk\Desktop\Latex\Test\test.tex [18:26:41] Root file remains unchanged from: c:\Users\jackk\Desktop\Latex\Test\test.tex. [18:26:41] Building root file: c:\Users\jackk\Desktop\Latex\Test\test.tex [18:26:41] Build root file c:\Users\jackk\Desktop\Latex\Test\test.tex

It kept on trying to build it for 10 minutes , at which point i gave in. Do you have any suggestion as to how I can make it work ?

jlelong commented 5 years ago

Is vscode stuck after invoking build? Is there any line in your log after Build root file c:\Users\jackk\Desktop\Latex\Test\test.tex? Can you compile the file from the terminal using latexmk?

atropos112 commented 5 years ago

There was nothing after "Build root file c:\Users\jackk\Desktop\Latex\Test\test.tex". So I thought it might be MikTex messing things up (and hence reinstalled it), things compile it MiKTeX just fine. For some reason, I get errors now so this might be useful.

These are the logs after latexmk:

[20:10:57] ACTIONS command invoked. [20:10:58] RECIPES command invoked. [20:10:59] BUILD command invoked. [20:10:59] Found root file from active editor: c:\Users\jackk\Desktop\Latex\Test\test.tex [20:10:59] Root file remains unchanged from: c:\Users\jackk\Desktop\Latex\Test\test.tex. [20:10:59] Building root file: c:\Users\jackk\Desktop\Latex\Test\test.tex [20:10:59] Build root file c:\Users\jackk\Desktop\Latex\Test\test.tex [20:11:00] Recipe step 1: latexmk, --max-print-line=10000,-synctex=1,-interaction=nonstopmode,-file-line-error,-pdf,c:/Users/jackk/Desktop/Latex/Test/test [20:11:00] Recipe returns with error: 1/null. [20:11:00] Cleaning auxillary files and retrying build after toolchain error. [20:11:00] CLEAN command invoked. [20:11:00] Found root file from active editor: c:\Users\jackk\Desktop\Latex\Test\test.tex [20:11:00] Root file remains unchanged from: c:\Users\jackk\Desktop\Latex\Test\test.tex. [20:11:00] Found root file from active editor: c:\Users\jackk\Desktop\Latex\Test\test.tex [20:11:00] Root file remains unchanged from: c:\Users\jackk\Desktop\Latex\Test\test.tex. [20:11:00] Recipe step 1: latexmk, --max-print-line=10000,-synctex=1,-interaction=nonstopmode,-file-line-error,-pdf,c:/Users/jackk/Desktop/Latex/Test/test [20:11:00] Recipe returns with error: 1/null.

and these are the logs after the other one:

[20:11:52] ACTIONS command invoked. [20:11:54] RECIPES command invoked. [20:11:56] BUILD command invoked. [20:11:56] Found root file from active editor: c:\Users\jackk\Desktop\Latex\Test\test.tex [20:11:56] Root file remains unchanged from: c:\Users\jackk\Desktop\Latex\Test\test.tex. [20:11:56] Building root file: c:\Users\jackk\Desktop\Latex\Test\test.tex [20:11:56] Build root file c:\Users\jackk\Desktop\Latex\Test\test.tex [20:11:56] Recipe step 1: pdflatex, --max-print-line=10000,-synctex=1,-interaction=nonstopmode,-file-line-error,c:/Users/jackk/Desktop/Latex/Test/test [20:11:57] LaTeX log parsed with 0 messages. [20:11:57] Recipe step 2: bibtex, test [20:11:57] Recipe returns with error: 1/null. [20:11:57] Cleaning auxillary files and retrying build after toolchain error. [20:11:57] CLEAN command invoked. [20:11:57] Found root file from active editor: c:\Users\jackk\Desktop\Latex\Test\test.tex [20:11:57] Root file remains unchanged from: c:\Users\jackk\Desktop\Latex\Test\test.tex. [20:11:57] Found root file from active editor: c:\Users\jackk\Desktop\Latex\Test\test.tex [20:11:57] Root file remains unchanged from: c:\Users\jackk\Desktop\Latex\Test\test.tex. [20:11:57] File cleaned: c:\Users\jackk\Desktop\Latex\Test\test.bbl [20:11:57] File cleaned: c:\Users\jackk\Desktop\Latex\Test\test.aux [20:11:57] File cleaned: c:\Users\jackk\Desktop\Latex\Test\test.blg [20:11:57] File cleaned: c:\Users\jackk\Desktop\Latex\Test\test.log [20:11:57] Recipe step 1: pdflatex, --max-print-line=10000,-synctex=1,-interaction=nonstopmode,-file-line-error,c:/Users/jackk/Desktop/Latex/Test/test [20:11:57] LaTeX log parsed with 0 messages. [20:11:57] Recipe step 2: bibtex, test [20:11:58] Recipe returns with error: 1/null.

strangely enough it produces the file and in this case the file is readable, nevertheless there are these worrying errors. Should I just ignore them or is there a way to fix them ?

atropos112 commented 5 years ago

During this process I have also got a notification suggesting following logs of MikTex:

This is BibTeX, Version 0.99d (MiKTeX 2.9.6840 64-bit) The top-level auxiliary file: test.aux I found no \citation commands---while reading file test.aux I found no \bibdata command---while reading file test.aux I found no \bibstyle command---while reading file test.aux (There were 3 error messages)

which to me it seems to be referring to bib(liography) which I didn't even attempt using in this small tex file.

jlelong commented 5 years ago

I think this is related to this. Can you try to set the configuration variable latex-workshop.latex.option.maxPrintLine.enabled to false in the Preference pane?

Also, can you try directly from the command line the following commands?

latexmk --max-print-line=10000 -pdf c:/Users/jackk/Desktop/Latex/Test/test
pdflatex --max-print-line=10000  c:/Users/jackk/Desktop/Latex/Test/test
atropos112 commented 5 years ago

Sorry for such a slow reply( I went to sleep).

I am not confident in this ecosystem, could you advise how to change the configuration variable?

I have reinstalled the latexmk plugin inside Bibtex (which was installed before but after i reinstalled Bibtex it disappeared), latexmk now produces a file without error. The other method still hits me with error:

[09:39:29] ACTIONS command invoked. [09:39:31] RECIPES command invoked. [09:39:32] BUILD command invoked. [09:39:32] Found root file from active editor: c:\Users\jackk\Desktop\Latex\Test\test.tex [09:39:32] Root file remains unchanged from: c:\Users\jackk\Desktop\Latex\Test\test.tex. [09:39:32] Building root file: c:\Users\jackk\Desktop\Latex\Test\test.tex [09:39:32] Build root file c:\Users\jackk\Desktop\Latex\Test\test.tex [09:39:33] Recipe step 1: pdflatex, --max-print-line=10000,-synctex=1,-interaction=nonstopmode,-file-line-error,c:/Users/jackk/Desktop/Latex/Test/test [09:39:34] LaTeX log parsed with 0 messages. [09:39:34] Recipe step 2: bibtex, test [09:39:34] Recipe returns with error: 1/null. [09:39:34] Cleaning auxillary files and retrying build after toolchain error. [09:39:34] CLEAN command invoked. [09:39:34] Found root file from active editor: c:\Users\jackk\Desktop\Latex\Test\test.tex [09:39:34] Root file remains unchanged from: c:\Users\jackk\Desktop\Latex\Test\test.tex. [09:39:34] Found root file from active editor: c:\Users\jackk\Desktop\Latex\Test\test.tex [09:39:34] Root file remains unchanged from: c:\Users\jackk\Desktop\Latex\Test\test.tex. [09:39:34] File cleaned: c:\Users\jackk\Desktop\Latex\Test\test.aux [09:39:34] File cleaned: c:\Users\jackk\Desktop\Latex\Test\test.blg [09:39:34] File cleaned: c:\Users\jackk\Desktop\Latex\Test\test.bbl [09:39:34] File cleaned: c:\Users\jackk\Desktop\Latex\Test\test.log [09:39:34] Recipe step 1: pdflatex, --max-print-line=10000,-synctex=1,-interaction=nonstopmode,-file-line-error,c:/Users/jackk/Desktop/Latex/Test/test [09:39:35] LaTeX log parsed with 0 messages. [09:39:35] Recipe step 2: bibtex, test [09:39:35] Recipe returns with error: 1/null.

Running latexmk --max-print-line=10000 -pdf c:/Users/jackk/Desktop/Latex/Test/test I get:

C:\Users\jackk>latexmk --max-print-line=10000 -pdf c:/Users/jackk/Desktop/Latex/Test/test Latexmk: This is Latexmk, John Collins, 25 October 2018, version: 4.61. Latexmk: All targets (test.pdf) are up-to-date

Running pdflatex --max-print-line=10000 c:/Users/jackk/Desktop/Latex/Test/test I get:

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6840 64-bit) entering extended mode (c:/Users/jackk/Desktop/Latex/Test/test.tex LaTeX2e <2018-04-01> patch level 5 ("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls" Document Class: article 2014/09/29 v1.4h Standard LaTeX document class ("C:\Program Files\MiKTeX 2.9\tex\latex\base\size11.clo")) (test.aux) [1{C:/Users/jackk/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (test.aux) )<C:/Program Files/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr10.pfb> Output written on test.pdf (1 page, 13856 bytes). Transcript written on test.log.

jlelong commented 5 years ago

Just to make it clear, latexmk is a wrapper around the different compiling commands and takes care of running the different commands in order based on your file content. With the very minimal content of your example, it just runs pdflatex.

Calling bibtex on a file containing no bibliography yields an error, hence the error you observe.

From your logs, I think you are using the wrong recipe, which is weird as the default recipe is to use latexmk. From the Command Palette (ctrl+shift+P) , call Build with recipe and explicitly choose latexmk.

atropos112 commented 5 years ago

I see that makes more sense now. WIth regards to the bibliography, i have tried using my (much bigger) latex file I use to use on Overleaf (where no error occurs), here however it does not recognize my citations and references. I know there are many standards when it comes to citations but for references, one expected to be able to use \label{something} in an equation etc. and then call upon it using \ref{something}, that however doesn't work.

jlelong commented 5 years ago

References need two latex compilations to get right and because of the bibtex error, you only compile once. I do no think your problem is related to the extension but rather to your LaTeX installation.

atropos112 commented 5 years ago

I was thinking the same (with regards where the problem lies) however when I use TeXworks to compile the same file it has no problems including bibliography, and surely both are relying on the same LaTeX installation, so the same problem should appear in both cases?

jlelong commented 5 years ago

TeXworks is probably not using latexmk. You have not answered my question concerning recipes

From your logs, I think you are using the wrong recipe, which is weird as the default recipe is to use latexmk. From the Command Palette (ctrl+shift+P) , call Build with recipe and explicitly choose latexmk.