0

Trying to compile a MWE using VSCode (latex, latex workshop, and utilities all installed) using TeXlive. The compiler only shows the following and stalls, I've let it run for hours without progress:

**This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)
 restricted \write18 enabled.

Other useful info - this is on a Windows system (runs fine on a mac). The build recipe I'm using only calls pdflatex. Under the tools option I have:

        {
            "name": "pdflatex",
            "command": "pdflatex",
            "args": [
                "--shell-escape",
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "%DOC%"
            ],
            "env": {}
        },

and under recipes:

        {
            "name": "pdflatex",
            "tools": [
                "pdflatex"
            ]
        },

I've also tried the default pdflatex, bibtex, pdflatex x2 to no success.

From powershell, it works fine:

pdflatex --shell-escape -synctex=1 -interaction=nonstopmode -file-line-error simple.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)
 \write18 enabled.
entering extended mode
(./simple.tex
LaTeX2e <2022-06-01> patch level 5
L3 programming layer <2022-08-30>
(c:/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(c:/texlive/2022/texmf-dist/tex/latex/base/size10.clo))
(c:/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
(./simple.aux) [1{c:/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}
] (./simple.aux) )<c:/texlive/2022/texmf-dist/fonts/type1/public/amsfonts/cm/cm
r10.pfb>
Output written on simple.pdf (1 page, 12749 bytes).
SyncTeX written on simple.synctex.gz.

Transcript written on simple.log.

And for reference, the MWE is just:

\documentclass{article}
\begin{document}
  Hello World!
\end{document}

Any ideas on why it might be hanging only in the VSCode compiler?

4
  • Try without "--shell-escape".
    – vi pa
    Sep 6 at 15:15
  • @vipa Unfortunately same behavior with or without --shell-escape Sep 6 at 17:32
  • Seem that pdflatex can't find the file to compile specifies by VSCode through "%DOC%". Try without "%DOC%".
    – vi pa
    Sep 6 at 20:33
  • It does seem you're right that it isn't finding the file to compile. However, removing %DOC% doesn't seem to work. I also tried %DOC_W32%.tex, and %DOC_EXT_W32% as an option following this but no luck so far. Sep 7 at 0:21

1 Answer 1

1

Ultimately I discovered had defined

"latex-workshop.latex.external.build.command": "pdflatex"

Which low and behold states in the documentation:

This is useful when compiling relies on a Makefile or a bespoke script. When defined, it completely bypasses the recipes and root file detection mechanism.

Overriding all the build commands that I had mentioned above. Clearing that and rerunning made everything work perfectly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.