Update instructions on LuaLaTeX and LaTeX Workshop in VS Code/Codium

This commit is contained in:
Florian 2025-11-23 14:01:06 +01:00
parent a4ad98c7c0
commit a5e40be5da
2 changed files with 22 additions and 8 deletions

View File

@ -13,7 +13,7 @@ LaTeX Workshop uses so-called recipes to compile documents. A recipe refers to a
1. Launch the VS Code settings and search for “recipes.”
2. In the “Latex-workshop > LaTeX: Recipes” section, click on “Edit in settings.json.”
3. Go ahead and add the following two entries to the list. The first one just uses the `pdflatex` compiler twice to build our document, whereas the second one adds an intermediate round of `biber` compilation.
3. Go ahead and add the following two entries to the list. The first one just uses the `pdflatex` compiler twice to build our document, whereas the second one adds an intermediate round of `biber` compilation and changes the LaTeX compiler to `lualatex`.
```json
"latex-workshop.latex.recipes": [
@ -25,12 +25,12 @@ LaTeX Workshop uses so-called recipes to compile documents. A recipe refers to a
]
},
{
"name": "pdflatex -> biber -> pdflatex × 2",
"name": "lualatex -> biber -> lualatex × 2",
"tools": [
"pdflatex",
"lualatex",
"biber",
"pdflatex",
"pdflatex"
"lualatex",
"lualatex"
]
},
// EXISTING ENTRIES GO HERE
@ -51,6 +51,17 @@ LaTeX Workshop uses so-called recipes to compile documents. A recipe refers to a
],
"env": {}
},
{
"name": "lualatex",
"command": "lualatex",
"args": [
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
],
"env": {}
},
// EXISTING ENTRIES GO HERE
]
```
@ -67,13 +78,15 @@ LaTeX Workshop uses so-called recipes to compile documents. A recipe refers to a
## Some useful notes
+ LaTeX Workshop will always try to compile the file your cursor is currently in. If you are working in sub-files, then this will result in errors. You can **specify the document root** by adding a magic TeX root comment. Press `Ctrl + Shift + P` and select “Insert !TeX magic root command.” Then simply select your root document and compile again. We provided these comments for you in all exercise files:
+ LaTeX Workshop has a [process of deciding which file to compile](https://github.com/James-Yu/LaTeX-Workshop/wiki/Compile#latex-workshoplatexbuildforceRecipeUsage). Unfortunately, our project archive tends to confuse the plugin, resulting in compiler errors. You can **specify the document root** by adding a magic TeX root comment. We provided these comments for you in all exercise files:
```tex
```
% !TeX root = ../../main-exercises.tex
```
This plugin offers a couple of other handy features:
+ However, by default, **LaTeX Workshop ignores them** because they may pose a security threat if you cannot trust the project you are compiling. See [this issue](https://github.com/James-Yu/LaTeX-Workshop/issues/3027) for more details. To enable them anyway, go to your settings and deactivate the “Force Recipe Usage” checkbox.
The **LaTeX Workshop** plugin offers a couple of other handy features:
+ Sometimes, it is helpful to kill all compiler processes and **clean up the auxiliary files** afterwards.
+ If you need to **find a certain section** in the PDF or in the source document, you can use the “Navigate, select and edit” menu.

View File

@ -1,3 +1,4 @@
% !TeX root = ./main-exercises.tex
\documentclass[a4paper,english]{report}
% Language and font encoding