19

I want to use the vs code extension Latex Workshop and want to set up my own recipe for compiling the documents. The faq are good but missing the part where they tell where the recipes are stored and where to put your custom recipe. Could someone help me out on that?

20

Assume that you have to make a recipe that uses pdflatex once only, not pdflatex > biblatex > pdflatex > pdflatex.

In settings.json:

  • Add this to "latex-workshop.latex.recipes":

    {
        "name": "pdflatex",
        "tools": [
          "pdflatex"
        ]
    }
    
  • Add this to "latex-workshop.latex.tools" if it is not present:

    {
        "name": "pdflatex",
        "command": "pdflatex",
        "args": [
            "--shell-escape", // if you want to have the shell-escape flag
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "%DOC%.tex"
        ]
    }
    

Don't forget to add the .tex after "%DOC%".

4
  • Thanks @JouleV that solved my problem. Still I have no idea about the recipe but, I could remove latexmk from the tool chain, can compile my pdf now. In addition I learned something new about how to use VS code. Double thx :) – FuzzyTemper Mar 11 '19 at 13:36
  • Actually I am wondering why someone wanted to use pdflatex > biblatex > pdflatex > pdflatex. What would be the benefit? – FuzzyTemper Mar 11 '19 at 13:43
  • @FuzzyTemper Well, you should not remove latexmk. As for the second recipe: look at the amazing use of BibLaTeX. – user156344 Mar 11 '19 at 14:03
  • 2
    @user156344 and how do you use the newly created recipe in VS Code? – Vladimir Jul 23 '19 at 13:43
3

Here is how I entered in settings.json and it worked well. Thanks user156344.

{
"workbench.colorTheme": "Noctis",
"editor.fontFamily": "'Droid Sans Fallback', 'Droid Sans Mono', 'monospace', monospace",
"editor.fontSize": 20,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 5000,
"latex-workshop.view.pdf.viewer": "tab",

"latex-workshop.latex.tools":[
    {
"name": "pdflatex",
"command": "pdflatex",
"args": [
    "--shell-escape", // if you want to have the shell-escape flag
    "-synctex=1",
    "-interaction=nonstopmode",
    "-file-line-error",
    "%DOC%"
  ]
 }
],


 "latex-workshop.latex.recipes":[
   {
     "name": "pdflatex",
     "tools": [
       "pdflatex"
       ]
     }
   ]
}
2

To edit recipes you should go on the Code Tab (from the name of the program, Visual Studio Code), then Preferences, and from there Settings. Open the tree for the Extension settings and you will find your LaTeX (Workshop) settings. Click on "Edit in settings.json" and you will see the file opened for your edits.

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.