<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Thanks, Zdeněk. I found the problem and a solution for it discussed here: <br><a href="https://tex.stackexchange.com/questions/263696/polyglossias-setotherlanguage-blocks-imakeindexs-indexprologue">https://tex.stackexchange.com/questions/263696/polyglossias-setotherlanguage-blocks-imakeindexs-indexprologue</a>. The solution did work for me. <br><br>Briefly, the problem is attributed to bidi's 
restoring the <code>book</code> definition of the <span style="font-family:monospace,monospace"><code>theindex</code></span> environment for no apparent reason.

The solution is to insert the following lines between the <span style="font-family:monospace,monospace">\usepackage{imakeindex}</span> and <span style="font-family:monospace,monospace">\makeindex[intoc]</span> lines:<br><br>

<p style="margin:0px;text-indent:0px;white-space:pre-wrap"><span style="font-family:monospace,monospace">% nullify bidi redefinition</span></p><span style="font-family:monospace,monospace">
</span><p style="margin:0px;text-indent:0px;white-space:pre-wrap"><span style="font-family:monospace,monospace">% this should go after polyglossia and imakeidx have been loaded</span></p><span style="font-family:monospace,monospace">
</span><p style="margin:0px;text-indent:0px;white-space:pre-wrap"><span style="font-family:monospace,monospace">\let\imakeidxtheindex\theindex</span></p><span style="font-family:monospace,monospace">
</span><p style="margin:0px;text-indent:0px;white-space:pre-wrap"><span style="font-family:monospace,monospace">\let\imakeidxendtheindex\endtheindex</span></p><span style="font-family:monospace,monospace">
</span><p style="margin:0px;text-indent:0px;white-space:pre-wrap"><span style="font-family:monospace,monospace">\AtBeginDocument{%</span></p><span style="font-family:monospace,monospace">
</span><p style="margin:0px;text-indent:0px;white-space:pre-wrap"><span style="font-family:monospace,monospace">  \let\theindex\imakeidxtheindex</span></p><span style="font-family:monospace,monospace">
</span><p style="margin:0px;text-indent:0px;white-space:pre-wrap"><span style="font-family:monospace,monospace">  \let\endtheindex\imakeidxendtheindex</span></p><span style="font-family:monospace,monospace">
</span><p style="margin:0px;text-indent:0px;white-space:pre-wrap"><span style="font-family:monospace,monospace">}</span></p><span style="font-family:monospace,monospace">
</span><p style="margin:0px;text-indent:0px;white-space:pre-wrap"><br></p>Kamal Abdali<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 25, 2018 at 4:25 AM, Zdenek Wagner <span dir="ltr"><<a href="mailto:zdenek.wagner@gmail.com" target="_blank">zdenek.wagner@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">You have to redefine the header, it automatically inserts \chapter*{Index}. You have to remove the asterisk. I do not remember the details, I would have to search in the documentatin but it is written there.<br><br></div><div class="gmail_extra"><br clear="all"><div><div class="m_3704635144416860446gmail_signature" data-smartmail="gmail_signature">Zdeněk Wagner<br><a href="http://ttsm.icpf.cas.cz/team/wagner.shtml" target="_blank">http://ttsm.icpf.cas.cz/team/<wbr>wagner.shtml</a><br><a href="http://icebearsoft.euweb.cz" target="_blank">http://icebearsoft.euweb.cz</a></div></div>
<br><div class="gmail_quote"><div><div class="h5">2018-04-24 23:09 GMT+02:00 Kamal Abdali <span dir="ltr"><<a href="mailto:k.abdali@acm.org" target="_blank">k.abdali@acm.org</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif;font-size:small">To get the index listed in the table of contents, I include these two lines in the preamble of a xelatex+polyglossia+bidi program:<br><br>\usepackage[imakeidx]<br>\makeindex[intoc]<br><br>My problem is that while the index does get produced it doesn’t get listed in the TOC. The trouble can be reproduced in this small program:<br><br>%%%%%%%%%%%%%%%%%%%<br>\documentclass{book}<br><br>\usepackage{imakeidx}<br>\makeindex[intoc]<br><br>\usepackage{polyglossia}<br>\usepackage{bidi}       %%%%%<br>\setmainlanguage{english}   <br><br>\title{Facts}<br>\author{Aleck}<br>\date{}<br><br>\begin{document}<br>\maketitle<br>\tableofcontents<br>\chapter{Stars}<br>Sirius, the brightest star in the night sky, is actually a double star.<br>\index{Sirius}<br>\printindex <br>\end{document}<br>%%%%%%%%%%%%%%%%%%%%<br><br>The above program produces the index without listing it in the TOC. However, if you comment out the  \usepackage{bidi} line, the index IS produced and listed in TOC as expected.<br><br>Note that the above program doesn’t really need bidi as all of its output text is in the Latin script. But I do need the bidi feature  in the actual document that I need to process.<br><br>Any help will be appreciated.<span class="m_3704635144416860446HOEnZb"><font color="#888888"><br><br></font></span></div><span class="m_3704635144416860446HOEnZb"><font color="#888888"><div style="font-family:arial,helvetica,sans-serif;font-size:small">Kamal Abdali<br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div></font></span></div>
<br><br>
<br></div></div>
------------------------------<wbr>--------------------<br>
Subscriptions, Archive, and List information, etc.:<br>
  <a href="http://tug.org/mailman/listinfo/xetex" rel="noreferrer" target="_blank">http://tug.org/mailman/listinf<wbr>o/xetex</a><br>
<br></blockquote></div><br></div>
<br><br>
<br>
------------------------------<wbr>--------------------<br>
Subscriptions, Archive, and List information, etc.:<br>
  <a href="http://tug.org/mailman/listinfo/xetex" rel="noreferrer" target="_blank">http://tug.org/mailman/<wbr>listinfo/xetex</a><br>
<br></blockquote></div><br></div></div>