I am typesetting a Malayalam book using xelatex. It has two indices, namely, "name" and "subject", for which I am using imakeidx. Now, I would like to separate the list of words with a heading in bold of the first letter, as seen in many books. That is, the list of words beginning with c in the index will start with a capital "C" in bold like a subheading. One solution for this in books with a single index is to use a style file with makeindex, as described here That is possible when you call makeindex separately after compiling the book. But in my case, when using imakeidx, I don't have to call makeindex separately, but indices also are generated along with the xelatex compilation. I even tried the solution suggested here for imakeidx, but that too didn't work! So, I am not sure how I can get that style in my index. I tried using the stylefile as an option in the call to \makeindex command that has to be included in the preamble, but it doesn't work. I am giving below an MWE of the problem.
\documentclass[a5paper,11pt,openany]{book}
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\usepackage{polyglossia,xltxtra}
\newfontfamily\malayalamfont[Script=Malayalam,AutoFakeBold=4.0,AutoFakeSlant=0.4]{Rachana.ttf}
\setmainfont{Rachana}
\setromanfont{FreeSerif}
\let\malayalamfontsf\sffamily
\let\malayalamfontrm\rmfamily
\def\xsans#1{{\malayalamfontsf#1}}
\def\xromn#1{{\fontencoding{T1}\fontfamily{cmr}\selectfont#1}}
\newfontfamily\engfont{FreeSerif}
\DeclareTextFontCommand{\myfont}{\engfont}
\setdefaultlanguage{malayalam}
\usepackage{imakeidx}
\makeindex[name=subject,title=വിഷയശബ്ദാവലി,columns=2,intoc=true]
\makeindex[program=makeindex,options=-s pyro,columns=2,intoc=true]
\begin{document}
\index[subject]{എയറോണമി}
അഹമദാബാദ് ടെക്സ്റ്റൈൽ ഇൻഡസ്ട്രീസ് റിസർച്ച് അസോസിയേഷൻ\index[subject]{അഹമദാബാദ് ടെക്സ്റ്റൈൽ ഇൻഡസ്ട്രീസ് റിസർച്ച് അസോസിയേഷൻ}
Ahmedabad Textile Industry's Research Association, ATIRA\index[subject]{Ahmedabad Textile Industry's Research Association, ATIRA}
\clearpage
അറ്റോമിക് പവർ പ്ലാന്റ്, താരാപൂർ\index[subject]{അറ്റോമിക് പവർ പ്ലാന്റ്, താരാപൂർ}
ഗ്യാസ് ടർബൈൻ റിസർച്ച് എസ്റ്റാബ്ലിഷ്മെന്റ്\index[subject]{ഗ്യാസ് ടർബൈൻ റിസർച്ച് എസ്റ്റാബ്ലിഷ്മെന്റ്}
എയറോനോട്ടിക്കൽ ഡെവലപ്മെന്റ് ഏജൻസി\index[subject]{എയറോനോട്ടിക്കൽ ഡെവലപ്മെന്റ് ഏജൻസി}
റ്റാറ്റാ ഇൻസ്റ്റിറ്റ്യൂട്ട് ഒഫ് ഫണ്ടമെന്റൽ റിസർച്ച്\index[subject]{റ്റാറ്റാ ഇൻസ്റ്റിറ്റ്യൂട്ട് ഒഫ് ഫണ്ടമെന്റൽ റിസർച്ച്}
ആൻട്രിക്സ് കോർപറേഷൻ\index[subject]{ആൻട്രിക്സ് കോർപറേഷൻ}
ANTRIX Corporation\index[subject]{ANTRIX Corporation}
\printindex[subject]
\end{document}
I thank anyone who can find a solution to this problem in advance.
headings_flag, it will split up the first byte, and you will get lots of errors. You would need a index program which understand unicode like xindex or xindy to get sensible headings. – Ulrike Fischer Sep 23 '20 at 16:53