This minimum example is behaving very strangely on my computer:
\documentclass[a4paper]{book}
\usepackage{imakeidx}
\makeindex
\makeindex[name=foo]
\begin{document}
\printindex %if I delete this line, both indices at the end show up as expected
%if it is here, there is no index at the beginning of the file
%and only the foo index shows up after the "content"
\index[foo]{Some word} asdadas
\index{Another} asdadas
\printindex
\printindex[foo]
\end{document}
Problem is, I want the index to be at the beginning of the book. What seems to happen is that the first printindex somehow causes the .idx and the resulting .ind file to be empty.
Is this a configuration error or is something wrong in the code I provided?
imakeidxis intended as a one-pass mechanism, so the index data will only be available at the end of the run. you might try using the[original]option (not tested), but i am pretty sure that the simple fact of specifying \makeindexwill cause the.idxfile to be deleted. with[original], it will be necessary to runmakeindexseparately, but the deletion of the.ind` file might be spared. – barbara beeton Mar 26 '18 at 20:45multind,splitindexandxindy. i don't have experience with any of those. butimakeidxis the most up to date, and its author is active in this forum. i'll poke him and ask him to look at this question. – barbara beeton Mar 26 '18 at 21:20