<div dir="ltr"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
The page with the \index commands isn't shipped out yet, but you<br>
are already closing the .idx file. Therefore put a \newpage<br>
at the beginning of \printindex.<br>
<br>
<br></blockquote><div><br>Thanks for the explanation. Even simpler putting 
<br><br><style type="text/css">p, li { white-space: pre-wrap; }</style>
<p style="margin: 0px; text-indent: 0px;">\immediate\write18{makeindex \jobname.idx}</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">before \documentclass, will do.<br></p> </div>
</div><br></div>