Skip to content

Latest commit

 

History

History
65 lines (49 loc) · 1.8 KB

latex_workshop_glossaries_recipe.adoc

File metadata and controls

65 lines (49 loc) · 1.8 KB

LaTeX Workshop & Glossary

These steps describe hwo to enable LaTeX Workshop to generate a proper glossary.

1. Open Settings

Open the settings.json file at the LaTeX Workshop extension position. This is done easiest following these steps:

  1. File → Preferences → Settings

  2. In 'Search setting' input 'recipe'

    • The list gets filtered down considerably

  3. Look for these two entries:

    • Latex-workshop > Latex: Recipes

    • Latex-workshop > Latex: Tools

Both entries have a edit in settings.json link, pressing it will bring you directly to the correct section in the settings.json. Use that for the next two steps.

2. Add tool

To generate the glossary entries an external tool called makeglossaries is required. This tool has already been installed automatically by installing the glossaries package defined in the header.tex file.

Now we need to teach LaTeX Workshop about its existence. Add the following tool definition to the latex-workshop.latex.tools array:

{
    "name": "makeglossaries",
    "command": "makeglossaries",
    "args": [
        "%DOCFILE%"
    ],
    "env": {}
}

3. Add recipe

Similar to bibtex generating glossaries is a little cumbersome. You don’t have to run this every time you build the document, but every time you want the glossary to be updated properly (so at least run it before reviews).

We will define a recipe to do this job (running pdflatex thrice is not a typo!). Add the following recipe definition to the latex-workshop.latex.recipes array:

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

4. Restart VS Code

Restarting is the easiest, and most robust way to properly load the new settings into the UI.