I am typesetting a multilingual book with xetex, using polyglossia for different fonts. Since the index contains different languages I need to use a main font which contains both languages. But one chapter contains trans i, can I change the index font for a specific chapter?
I tried using the idxlayout package and this command in the preamble: (\englishfont is defined using \newfontfamily command)
\renewcommand*{\indexfont}{\englishfont}
but when I try to change that to another font in a \begingroup it is not working.
\begingroup
\renewcommand*{\indexfont}{\malayalamfont}
\KOMAoptions{fontsize=11pt}
സ്വകാര്യവ്യക്തിബോധം, രേഖീയയുക്തി,
ഭാഷാദേശീയത, ഗദ്യത്തിന് കൈവന്ന മേൽക്കൈ, പൊതുമണ്ഡലനിർമ്മിതി
തുടങ്ങിയവയ്ക്കെല്ലാം പിന്നിൽ അച്ചടിയുണ്ടായിരുന്നു. മാധ്യമചിന്തകനായ
മാർഷൽ മക് ലൂഹൻ\index{മാർഷൽ മക് ലൂഹൻ} `ഗുട്ടൻബർഗ്ഗ് ഗാലക് സി'\index{ഗുട്ടൻബർഗ്ഗ് ഗാലക് സി} എന്ന് വിശേഷിപ്പിച്ച പുതിയ
ലോകസന്ദർഭത്തിന്റെയും ജീവിതാവബോധത്തിന്റെയും കേന്ദ്രമായി അത് നിലനിന്നു.
\endgroup
This encounter has since passed into the folklore of the coming of print to Bengal. Carey's own arrival in India had been in November
1793 and from the very beginning, his one aim had been to translate
and print the gospels in Bengali. As early as in January 1794,
Carey's associate John Thomas\index{Thomas, John} consulted a printer
in Calcutta about the costs of printing a Bengali Bible. But
financial hardship sent Carey all the way up to Madnabati in Malda
district, where an indigo planter by the name of George Udny provided
employment to both Carey and Thomas. All along, Carey continued to
learn Bengali from his \textit{munshi} Ramram Basu,\index{Basu, Ramram}
\printindex
Is there any way to change the index font inside \begingroup? I want the index in the English part to be in englishfont and the other language part's index in a different font. I can only choose one font with \renewcommand*{\indexfont}{\englishfont}. I want to change the index font inside \begingroup.
\indexcommands but does have a\subsectiondid you mean to ask about table of contents? In either case can you make a small but complete example that shows the problem. – David Carlisle Nov 17 '21 at 07:51\index{ഗുട്ടൻബർഗ്ഗ് ഗാലക്സി@{\malayamfont ഗുട്ടൻബർഗ്ഗ് ഗാലക്സി}}– David Carlisle Nov 17 '21 at 08:51\newcommand\mindex[1]{\index{#1@{\malayamfont#1}}}then you just need\index{abc}for Latin scipts and\mindex{ഗുട്ടൻബർഗ്ഗ് ഗാലക്സി}for Malayalam – David Carlisle Nov 17 '21 at 11:22