Question: I have started to configure VSC as my default latex text editor, using the **"Latex Workshop"** extension.

My question is: How can I make the auxiliary files generated when compiling the project be saved in a separate folder? files (.aux, .bbl, .blg, .fls ...)

I read that this can be done by adding **--aux-directory=FOLDER** to the compile-time statement but I don't know how I can do that in VSC.

Any idea how to do it?

Thank you very much.

Answer: 
If you are using pdflatex, you can add the flag `--aux-direcotry=.aux` to the tool arguments in the setting.json file, such as:

```
    {
        "name": "pdflatex",
        "command": "pdflatex",
        "args": [
            "-synctex=1",
            "-interaction=nonstopmode",
            "-file-line-error",
            "--aux-directory=.aux",
            "%DOC%"
        ],
        "env": {}
    },

```

The synctex file will still be in the source directory. You need it there next to the pdf.

Then it is convenient to just add the .aux folder to .gitignore if you are using it.
A very simple solution is to save everything in a temporary folder. This is easy to set up: Search for "latex outdir" in settings, and set it to `%TMPDIR%` as in the image below.

This will also write the pdf into a temporary folder, which I personally like. If you want to check the pdf, just use Ctrl+Alt+V. You may then optionally save the pdf from the viewer.

[![enter image description here](https://i.stack.imgur.com/OPfrZ.png)](https://i.stack.imgur.com/OPfrZ.png)