I want to create a multilingual (Russian and English) alphabetical index. makeidx doesn't work with Cyrrilic symbols, so as far as I know the best solution is to use xindy option in imakeidx. I tried to run the code that was found here:
\documentclass[openany]{book}
\usepackage[T1, T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english, russian]{babel}
\usepackage{tikz}
\usepackage{xcolor}
\definecolor{purpl}{RGB}{150, 120, 182}
\usepackage{calc}
\usepackage[xindy]{imakeidx}
\makeindex[program=texindy, options=-M mystyle.xdy -L russian -C utf8]
\makeatletter
\newcommand{\rindex}[2][\imki@jobname]{%
\index[#1]{\detokenize{#2}}%
}
\makeatother
\usepackage[breaklinks,pdftex,hyperindex,unicode]{hyperref}
\usepackage{filecontents}
\begin{filecontents*}{mystyle.xdy}
;;; xindy style file
(markup-locclass-list :open "\dotfill" :sep "")
(define-letter-groups
("a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m"
"n" "o" "p" "q" "r" "s" "t" "u" "v" "w" "x" "y" "z"))
(require
"rules/latin-tolower.xdy")
(use-rule-set
:run 0
:rule-set ("latin-tolower"))
(markup-letter-group
:open-head "\nopagebreak\tikz\node at (0pt,0pt) [draw=none,fill=purpl!50,line width=1pt,inner sep=5pt]{\parbox{\linewidth-2\fboxsep-2\fboxrule-2pt}{\centering\large\sffamily\bfseries\textcolor{white}{ "
:close-head "}}};\vspace*{0.2cm}\nopagebreak"
:capitalize)
\end{filecontents*}
\begin{document}
\chapter{Первая}
\rindex{часть}
\rindex{дерево}
\rindex{электрон}
\rindex{well}
\printindex
\end{document}
I use TeXstudio 4.5.2 on Windows 10 and I compiled the code with PDFLaTeX compiler for document and texindy option for index:
And what I got:
You can see that the index isn't sorted in the correct order. Moreover, the code in filecontents* environment doesn't work at all, because there aren't any purple rectangles as in example at the link above.
However, if I use xindex option:

--- I will get a properly sorted index:
But the code in filecontents* environment still doesn't work.
What should I do to get an alphabetically sorted index?



upmendex. See an example here: https://tex.stackexchange.com/a/650880/5735 – Javier Bezos Jul 31 '23 at 14:53upmendexseems to be working. But can I automatize this process? To compileidxfile I need to launchcmdfrom folder where my file is and manually inputupmendex -s names <your file>.idxcommand. And TeXstudio doesn't supportupmendexcompiler. – Anton Dmitrievich Jul 31 '23 at 15:22