0

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:

enter image description here

And what I got:

enter image description here

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: enter image description here

--- I will get a properly sorted index:

enter image description here

But the code in filecontents* environment still doesn't work.

What should I do to get an alphabetically sorted index?

0 Answers0