# Makeindex error when using \tableofcontents or \chapter with arabi package

When I remove the three lines

\tableofcontents
\chapter{1}
\chapter{2}


from the following document, makeindex works without problem and the index is printed. But in presence of these lines I get an error and the index is not printed.

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[T1,LFE,LAE,OT1]{fontenc}
\usepackage[farsi,english,arabic]{babel}
\usepackage{makeidx}
\makeindex
\TOCLanguage{farsi}
\title{عنوان}
\author{نویسنده}

\begin{document}
\selectlanguage{farsi}
\maketitle
\tableofcontents
\chapter{1}
\chapter{2}

سلام\index{سلام}
\printindex
\end{document}

• I'm afraid that MakeIndex is not able to comply with non Latin scripts. – egreg Oct 22 '14 at 17:15
• @egreg As I wrote if I remove those three line, Makeindex seems to worka and the index is printed. – Name Oct 22 '14 at 17:17
• I get no error from your example. – egreg Oct 22 '14 at 17:20
• @egreg when running Makeindex I get: makeindex.exe, version 2.15 [MiKTeX 2.9] (kpathsea + Thai support). Scanning input file temp.idx...done (0 entries accepted, 1 rejected). Nothing written in temp.ind. Transcript written in temp.ilg. – Name Oct 22 '14 at 17:26
• The problem is that when a chapter starts, the page numbering changes and so the annotations in the .idx file are not understood by MakeIndex any more. – egreg Oct 22 '14 at 17:48