# Missing headers with imakeidx' index

The MCE and images below point out that, with imakeidx' index, some headers may be missing, e.g. on the:

• even page (chapter stuff) just before index 1st page (the index starting on an odd page, just at its top),
• index 1st page (the index starting on an odd page, not at its top).

Do you see how to fix this?

\documentclass{book}
\usepackage{imakeidx}
\usepackage[papersize=12cm]{geometry}
\usepackage{lipsum}

\indexsetup{level=\section*,toclevel=section,noclearpage}

\makeindex

\newcommand{\test}[1]{%
\chapter{Foo}
\section{Bar}

Baz\index{Baz}

\lipsum[1-#1]

\printindex
}

\begin{document}
% Missing header on the even page (6) just before index 1st page (7)
\test{8}
% Missing header on index 1st page (13)
\test{5}
\end{document}


By default imakeidx sets the page style of the first page of the index to plain. You need to keep it as headings.
Change your \indexsetup to:
\indexsetup{level=\section*,toclevel=section,noclearpage,firstpagestyle=headings}

You could probably make a case that imakeidx should not change the heading style when the noclearpage option is set. But I'm a little cautious about telling the author of that particular package what to do! :)