4

I have set up Latex using VScode on windows 10 with LaTeX Workshop extension, but I am running into some issues, every time I try building the project it gives me the error: Recipe terminated with error. I have followed with many posts here and to no avail unfortunately. The output log looks like this:

Sorry, but latexmk did not succeed for the following reason:

  MiKTeX could not find the script engine 'perl' which is required to execute 'latexmk'.

Remedy:

  Make sure 'perl' is installed on your system.

The log file hopefully contains the information to get MiKTeX going again:

  C:\Users\Local\MiKTeX\miktex\log\latexmk.log

For more information, visit: https://miktex.org/kb/fix-script-engine-not-found
latexmk: major issue: So far, you have not checked for MiKTeX updates.

I installed Perl and setup the path and added the suggested log file to my JSON file and still I get the same error. My .json file looks like:

{
    "window.zoomLevel": 0,
    "workbench.colorTheme": "Abyss",
    "terminal.integrated.shell.windows": "C:/windows/System32/cmd.exe",
    "workbench.settings.editor": "json",
    "latex-workshop.view.pdf.viewer": "tab",
    "latex-workshop.latex.search.rootFiles.include" : ["C:/Users/vscode-lecture-files/**/*.tex"],
    "latex-workshop.latex.autoBuild.run":"onFileChange",
    "latex-workshop.latex.recipes": [
        {  
            "name": "latexmk",  
            "tools": [  
                "latexmk"  
            ],
            "includePath":[
                
                "C:/Users/Local/Programs/MiKTeX/miktex/bin/x64/latexmk.exe",
                "C:/Dwimperl",
                "C:/Users/Local/MiKTeX/miktex/log/latexmk.log",
                "C:/Dwimperl/perl/bin/perl.exe"
            ]
              
        },  

        {
            "name": "pdflatex*2",
            "tools": [
                "pdflatex",
                "pdflatex" 
            ],
            "env": {}
        }
    ],
    "latex-workshop.latex.verbatimEnvs":[
        "verbatim",
        "lstlisting",
        "minted"
    ],
    "security.workspace.trust.untrustedFiles": "open"
}


Can someone help me understand what's going on. Thanks

Jamie
  • 365
  • 2
  • 5
  • 13
  • I see you are using [DWIM Perl](https://perlmaven.com/dwimperl) ? Which version of perl is that? Could you try install [Strawberry perl](https://strawberryperl.com/) ? – Håkon Hægland Jan 31 '22 at 22:45
  • Also the include paths in your `settings.json` include file name paths, but those should by dir name paths, right? Anyway, according to the [documentation](https://github.com/James-Yu/LaTeX-Workshop/wiki/Install#setting-path-environment-variable) you should not need those settings, you only have to set the `PATH` environment variable correctly before you start VS Code, but even that should not be needed on Windows since the LaTeX installer will set the paths correctly for you – Håkon Hægland Jan 31 '22 at 22:58
  • Thanks! For some reason I am able to build and produce my pdf from the command window much easier than build from VScode. – Jamie Feb 03 '22 at 21:31

0 Answers0