0

I've been trying to adopt VS Code as my LaTeX editior of choice, since it has all of the features Atom has but more, once the extension LaTeX Workshop has been installed. My only gripe with it is that I can't seem to actually compile anything with LuaLaTeX as the compiler. What follows is for people who actually know something about how the settings are supposed to work in VSCode (because I sure don't).

I've added the following settings to the file settings.json, which is opened in a tab inside VSCode when USER SETTINGS are opened:

{   
    "latex-workshop.view.pdf.viewer": "browser",
    "latex-workshop.latex.clean.onFailBuild.enabled": true,
    "latex-workshop.latex.recipes": [
        {
            "name": "lualatex->biber->lualatex",
            "tools": [
                "lualatex",
                "biber",
                "lualatex"
            ]
        },
        {
            "name": "latexmk",
            "tools": [
                "latexmk"
            ]
        },
        {
            "name": "pdflatex -> bibtex -> pdflatex*2",
            "tools": [
                "pdflatex",
                "bibtex",
                "pdflatex",
                "pdflatex"
            ]
        }
    ]
}

The settings themselves seem to have been entered correctly, since I get the error Skipping undefined tool "lualatex" in recipe "lualatex->biber->lualatex", Source: LaTeX Workshop (Extension). This indcates that the editor is able to parse the settings, but is unable to find lualatex.

The default setting of using latexmk seems to work, but it uses pdflatex by default. I'm running Ubuntu with a "normal" TeXLive installation, so LuaLaTeX should be available.

Has anyone ran into a similar issue and if so, how was it fixed?

EDIT:

LuaLaTeX is indeed available, since running lualatex --version in the terminal nets:

This is LuaTeX, Version 1.07.0 (TeX Live 2018)

Execute  'luatex --credits'  for credits and version details.

There is NO warranty. Redistribution of this software is covered by
the terms of the GNU General Public License, version 2 or (at your option)
any later version. For more information about these matters, see the file
named COPYING and the LuaTeX source.

LuaTeX is Copyright 2018 Taco Hoekwater and the LuaTeX Team.
  • 1
    Did you check if lualatex is really available? What happens in a terminal after lualatex --version? – Ulrike Fischer Oct 18 '18 at 8:57
  • LuaLaTeX is installed: This is LuaTeX, Version 1.07.0 (TeX Live 2018) Execute 'luatex --credits' for credits and version details. There is NO warranty. Redistribution of this software is covered by the terms of the GNU General Public License, version 2 or (at your option) any later version. For more information about these matters, see the file named COPYING and the LuaTeX source. LuaTeX is Copyright 2018 Taco Hoekwater and the LuaTeX Team. – TheSodesa Oct 18 '18 at 9:01
  • 1
    Then I would guess that "lualatex" is not a call to an application but a reference to some other section in the setting and that you need to setup it there. Is there somewhere in the settings something that setups the names "pdflatex" or "bibtex"? – Ulrike Fischer Oct 18 '18 at 9:04
  • Ah, there is a latex-workshop.latex.tools key, where the available tools are defined. I'll try editing that. – TheSodesa Oct 18 '18 at 9:11
2

Alright, so the issue was that I hadn't defined the tools lualatex and biber in the VS Code user settings file settings.json.

The following entries should be present in said file for things to work:

"latex-workshop.latex.recipes": [
        {
            "name": "lualatex->biber->lualatex",
            "tools": [
                "lualatex",
                "biber",
                "lualatex"
            ]
        }
    ],
    "latex-workshop.latex.tools": [
        {
            "name": "lualatex",
            "command": "lualatex",
            "args": [
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-pdf",
                "%DOC%"
            ]
        },
        {
            "name": "biber",
            "command": "biber",
            "args": [
                "%DOCFILE%"
            ]
        }
    ]
0

I think you should change it to

    "name": "lualatex->biber->lualatex x2",
    "tools": [
        "lualatex",
        "biber",
        "lualatex",
        "lualatex"
    ]

If you don't want biber you can simply remove it as in

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

I can't really comprehend why but I've seen a couple of posts mentioning that something that is along the lines of keyword may be mixed due to biber compiling (?) the document. Just make it similar to "pdfLatex x2", I suppose. Hey, you should know that this is just a correction. It was pointed out to me in the comments. So, heads off to JouleV for shedding light on it. You should follow the OP's answer. One point where I was struggling was accessing settings.json. In order to open settings.json, firstly, you have to go to the settings and type something along the lines of "workshop ui" in the bar. You can then change the settings. Oh, by the way, there is a checkbox under the Workshop > Editor tab that lets you split the code into two version. One of them is the default version which is read-only and the other one is an editable version of the settings.json. The chekbox is named something like "split the code".

  • 2
    The problem the OP is/was facing is that LaTeX Workshop doesn't have a tool named lualatex yet (this is resolved in the accepted answer where we tell LaTeX Workshop what lualatex is in latex-workshop.latex.tools). Placing the code above to settings.json won't solve the problem. – JouleV Mar 22 at 1:45
  • The guy answered his own question and this was just a follow-up or correction to his own answer. Wasn't that clear, should I clarify it? – Cenderme Mar 22 at 22:04
  • Welcome to TeX.SE! I think this is a useful note, for someone who has a similar question and finds this answer. Though the first step of the OP's particular problem was resolved by something else, a reminder that lualatex is best invoked twice is useful (though perhaps a tool like latexmk or arara would handle those things better). – ShreevatsaR Mar 22 at 23:04
  • Thanks! That was my first answer—i.e., if you can call it an answer. Funnily enough the answer belongs to the op as well. So he kinda answered his own question. 😜 – Cenderme Mar 22 at 23:34

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.