Latex-workshop: Why LaTeX-Workshop cannot build this document?

Created on 6 Apr 2018  ยท  2Comments  ยท  Source: James-Yu/LaTeX-Workshop

Description

Here is the document:

%!TEX program = xelatex
\documentclass[UTF8,a4paper]{article}
\title{Sample Title}
\author{Margatroid}
\begin{document}
\maketitle
\end{document}

How to reproduce

  1. Just save this document
  2. And it would cause an error

Expected behavior

Everything should be good.

Actual behavior

I've got an error. See logs for details.

Log messages


LaTeX Workshop Output

[17:49:46] Initializing LaTeX Workshop.
[17:49:46] Creating LaTeX Workshop http and websocket server.
[17:49:46] LaTeX Workshop initialized.
[17:49:46] Found root file from active editor: d:\Projects\LaTeXDocs\group-ver-2\test.tex
[17:49:46] Root file changed from: undefined. Find all dependencies.
[17:49:46] Instatiating new file watcher for d:\Projects\LaTeXDocs\group-ver-2\test.tex
[17:49:46] Parsing d:\Projects\LaTeXDocs\group-ver-2\test.tex
[17:49:46] Server created on 127.0.0.1:59125
[17:49:46] LaTeX Workshop version: 5.0.4
[17:49:46] Default data loaded.
[17:49:50] Parsing d:\Projects\LaTeXDocs\group-ver-2\test.tex for outline
[17:49:50] File watcher: responding to change in d:\Projects\LaTeXDocs\group-ver-2\test.tex
[17:49:50] Parsing d:\Projects\LaTeXDocs\group-ver-2\test.tex
[17:49:50] BUILD command invoked.
[17:49:50] Found root file from active editor: d:\Projects\LaTeXDocs\group-ver-2\test.tex
[17:49:50] Root file remains unchanged from: d:\Projects\LaTeXDocs\group-ver-2\test.tex.
[17:49:50] Building root file: d:\Projects\LaTeXDocs\group-ver-2\test.tex
[17:49:50] Build root file d:\Projects\LaTeXDocs\group-ver-2\test.tex
[17:49:50] Found TeX program by magic comment: xelatex
[17:49:50] Recipe step 1: xelatex, -synctex=1,-interaction=nonstopmode,-file-line-error,d:/Projects/LaTeXDocs/group-ver-2/test
[17:49:50] Parsing d:\Projects\LaTeXDocs\group-ver-2\test.tex for outline
[17:49:52] LaTeX log parsed with 0 messages.
[17:49:52] Recipe step 2: bibtex, test
[17:49:52] Recipe returns with error: 2/null.
[17:49:52] Cleaning auxillary files and retrying build after toolchain error.
[17:49:52] CLEAN command invoked.
[17:49:52] Found root file from active editor: d:\Projects\LaTeXDocs\group-ver-2\test.tex
[17:49:52] Root file remains unchanged from: d:\Projects\LaTeXDocs\group-ver-2\test.tex.
[17:49:52] Found root file from active editor: d:\Projects\LaTeXDocs\group-ver-2\test.tex
[17:49:52] Root file remains unchanged from: d:\Projects\LaTeXDocs\group-ver-2\test.tex.
[17:49:52] File cleaned: d:\Projects\LaTeXDocs\group-ver-2\test.bbl
[17:49:52] File cleaned: d:\Projects\LaTeXDocs\group-ver-2\test.aux
[17:49:52] File cleaned: d:\Projects\LaTeXDocs\group-ver-2\test.log
[17:49:52] File cleaned: d:\Projects\LaTeXDocs\group-ver-2\test.blg
[17:49:52] Recipe step 1: xelatex, -synctex=1,-interaction=nonstopmode,-file-line-error,d:/Projects/LaTeXDocs/group-ver-2/test
[17:49:53] LaTeX log parsed with 0 messages.
[17:49:53] Recipe step 2: bibtex, test
[17:49:54] Recipe returns with error: 2/null.
[17:49:56] Root file remains unchanged from: d:\Projects\LaTeXDocs\group-ver-2\test.tex.


Developer Tools Console

workbench.main.js:sourcemap:2217 Recipe terminated with error.
e.onDidNotificationChange @ workbench.main.js:sourcemap:2217
(anonymous) @ workbench.main.js:sourcemap:2217
e.fire @ workbench.main.js:sourcemap:166
e.notify @ workbench.main.js:sourcemap:2210
e.notify @ workbench.main.js:sourcemap:3037
e._showMessage @ workbench.main.js:sourcemap:2829
e._showMessage @ workbench.main.js:sourcemap:2828
e.$showMessage @ workbench.main.js:sourcemap:2828
e._doInvokeHandler @ workbench.main.js:sourcemap:2848
e._invokeHandler @ workbench.main.js:sourcemap:2848
e._receiveRequest @ workbench.main.js:sourcemap:2847
e._receiveOneMessage @ workbench.main.js:sourcemap:2847
(anonymous) @ workbench.main.js:sourcemap:2846
(anonymous) @ workbench.main.js:sourcemap:2849
e.fire @ workbench.main.js:sourcemap:166
(anonymous) @ workbench.main.js:sourcemap:291
emitOne @ events.js:96
emit @ events.js:191
readableAddChunk @ _stream_readable.js:178
Readable.push @ _stream_readable.js:136
onread @ net.js:560

Additional Information

The problem seems to be caused by the magic comment in the first line. If you delete it, everything will be fine. However, I have to use xelatex to deal with languages except English. And that means I have to use this magic comment.

What's more, according to the running log, the problem seems to be caused by BibTeX. And I've tried to disable it by deleting BibTeX in the config "latex-workshop.latex.tools" and the recipe "name": "pdflatex -> bibtex -> pdflatex*2",. Sadly, all those don't work for me.

Most helpful comment

After I delete my magic comment and change my config like this:(delete the "-pdf" and add "-xelatex"), it finally works well for me.

    "latex-workshop.latex.tools": [
        {
            "name": "latexmk",
            "command": "latexmk",
            "args": [
                "-xelatex",
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ]
        },

All 2 comments

After I delete my magic comment and change my config like this:(delete the "-pdf" and add "-xelatex"), it finally works well for me.

    "latex-workshop.latex.tools": [
        {
            "name": "latexmk",
            "command": "latexmk",
            "args": [
                "-xelatex",
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ]
        },

Remove the file head โ€œ%!TEX program = xelatexโ€ mybe works

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iainmstott picture iainmstott  ยท  5Comments

sth4nth picture sth4nth  ยท  3Comments

wstcegg picture wstcegg  ยท  5Comments

mdrozdo picture mdrozdo  ยท  4Comments

BjoernDaase picture BjoernDaase  ยท  3Comments