I have a problem with automatic sorting of lines containing information about authors of several articles, including Russian surname, first name and patronymic, other info, ORCID and e-mail. This information is written in separate *.ppl
files for each article. The main file reads all *.ppl
files and each line is set to some variables. The problem is that before the output to the "Information about authors" section, the lines need to be sorted by Cyrillic and then English alphabet.
Since there is a lot of code needed to read and process *.ppl
files here, I have simplified the code to start describing the problem. Let
\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,russian]{babel}
\newcounter{pplcount}
\newcommand\addp[1]{
\stepcounter{pplcount}
\expandafter\gdef\csname info\arabic{pplcount}\endcsname{#1}
}
\begin{document}
\addp{Валерий Валерьевич Валерьев; e-mail: [email protected]}
\addp{Борис Борисович Борисов; e-mail: [email protected]}
\addp{Александр Александрович Александров; e-mail: [email protected]}
\addp{Diana Davis; e-mail: [email protected]}
\makeatletter
\@nameuse{info3}
\@nameuse{info2}
\@nameuse{info1}
\@nameuse{info4}
\makeatother
\end{document}
then I need to use pdflatex to output the case-insensitive ordered list of authors first in the Russian alphabet ("А" "Б" "В" "Г" "Д" "Е" "Ж" "З" "И" "Й" "К" "Л" "М" "Н" "О" "П" "Р" "С" "Т" "У" "Ф" "Х" "Ц" "Ч" "Ш" "Щ" "Ъ" "Ы" "Ь" "Э" "Ю" "Я")
and then in the English alphabet for any number of authors (usually no more than 50). Since the authors may have the same last names, it is necessary to sort up to the first mismatched character. Occasionally, the same author may be repeated in different articles in the same journal. Of course, it would be cool to automatically remove duplicates (that is, everything up to the semicolon), but I can manually do it because this happens extremely rarely. The screenshot shows the correct sort order for my example, which I did manually.
Also I tried texindy
because it can sort Cyrillic and English strings separately. It works fine, but only if the sorted strings contain ONLY English or ONLY Cyrillic characters. In my case, only the e-mail remains in *.idx
, but in the section with the correct first Cyrillic letter. By the way datatool
package can sort Cyrillic strings but in the wrong order.
I am grateful to the tex.stackexchange community for the previous help! I hope someone can help me with this problem too.