# Makeindex is called on wrong *.idx file when using multiple indices with imakeidx [closed]

I, using Miktex and Texmaker, would like to create a book with multiple indices using imakeidx. However, I encounter the problem that makeindex is called on the wrong *.idx file, therefore no index is being generated.

The following MWE results (after pdfLatex-makeindex-pdfLatex runs) in a working, single index:

\documentclass{scrbook}
\usepackage{imakeidx}
\makeindex
\begin{document}
Peter\index{Peter} arrived at the house\index{House}.

\printindex
\end{document}


However, when I try the following non-working minimal example with two indices, no index is generated at all.

\documentclass{scrbook}
\usepackage{imakeidx}

\makeindex[name=persons,title=Persons]
\makeindex[name=places,title=Places]

\begin{document}

Peter\index[persons]{Peter} arrived at the house\index[places]{House}.

\printindex[persons]
\printindex[places]

\end{document}


After the first pdfLatex-run, the two *.idx files (persons.idx and places.idx) are generated and have the expected content. The makeindex-run however tries to load a file named "mwe.idx" (named after the *.tex file), which apparently doesn't exist, therefore Texmaker shortly gives the following error:

Input index file build/mwe.idx not found. Usage: makeindex [-ilqrcgLT] [-s sty] [-o ind] [-t log] [-p num] [idx0 idx1 ...]


and does not create the .ilg/.ind files.

In the Texmaker options (Options-->Configure-->Commands) I found that makeindex is called by using "makeindex build/%.idx". I assume that the problem is located here, however I'm unsure what to change to pass the correct filenames to makeindex.

• Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Reinstate Monica - M. Schröder Sep 24 '16 at 17:58
• I have no issue with the example; the build/mwe.idx looks suspicious, though. The build/ bit should be removed. – egreg Sep 24 '16 at 18:03
• The build/ is due to the fact that I checked the option "Use a build subdirectory for output files" in Texmaker to bring a little more structure into my project's folder. I removed it just to give it a try, but the problem remained the same. – Garfieldus Sep 24 '16 at 18:10
• 999 times out of 1000 when people configure tex to write files to non standard places it breaks some other tool in the chain, it's never worth the trouble, even when it works. – David Carlisle Sep 24 '16 at 18:14
• In fact, that is the cause of my trouble. The first time I unfortunately had only removed the "build" from the makeindex call, now it came to me that I should also remove the tick before "Use a build subdirectory for output files". And it works! – Garfieldus Sep 24 '16 at 19:10