[Tex/LaTex] Glossaries – how to deal with auxiliary files in another directory using MikTeX

auxiliary-filesglossariesmiktex

To keep my main folder clean, have redirected the auxiliary files using the -aux-directory=.\auxiliaries command in LaTeX and PdfLaTeX (1). However, when making the glossaries, TeXstudio gives the following message:

Auxiliary file 'main.aux' doesn't exist. Have you run LaTeX?

Pasting the same command into the Makeglossaries field yields the same result.

How can i make glossaries find the aux files?

Minimal working example that works when the aux files are in the main directory, but not when the aux files are redirected into a subfolder:

\documentclass[12pt, twoside, a4paper, english]{report}
\usepackage[toc,symbols,nomain]{glossaries}
\newglossaryentry{pi}{type=symbols,name={\ensuremath{\pi}},sort=pi, description={ratio of circumference of a circle to its diameter}}
\makeglossaries

\begin{document}
\printsymbols[title=List of Symbols]
\section{Text}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

\gls{pi}

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

\end{document}

[compilation commands in TeXstudio]1

Best Answer

Running on the command line makeglossaries --help one can see the options it knows. Beside other the -d switch:

enter image description here

So add -d auxiliaries to the call.