# Other Alphabet [Turkish Language] sorting in Index

My code;

\documentclass[a4paper,12pt]{book}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage{makeidx}
\makeindex
\usepackage{filecontents}
\begin{filecontents}{\jobname.mst}
delim_0 "\\dotfill"
delim_1 "\\dotfill"
delim_2 "\\dotfill"
\end{filecontents}

\begin{document}

\index{Apple}\index{Blackberry}\index{Current}\index{Çay}\index{çay}
\index{Date}\index{Eggplant}\index{Fake}\index{Grape}\index{History}
\index{Ilımlı}\index{İzmir}\index{ideal}\index{Jackfruit}
\index{Kitchen}\index{Lemon}\index{Mango}\index{Narrow}
\index{Over}\index{Özgür}\index{özel}\index{Pear}\index{Raspberry}
\index{Satsuma}\index{Şimşek}\index{şimşek}\index{Tomato}
\index{Yes}\index{Zebra}\index{70}

\printindex

\end{document}


The Turkish Alphabet is;

A B C Ç D E F G Ğ H I İ J K L M N O Ö P R S Ş T U Ü V Y Z

a b c ç d e f g ğ ı i j k l m n o ö p r s ş t u ü v y z.

I am not able to sort in Turkish Alphabet in Index.

I find another same question, but don't working. Does anyone know how to fix it in LaTeX?

Note:İ is uppercase of i and ı is lowercase of I in my language.

If it is possible to make it without using any babel and/or xindy packages it will really helpful to me. I mean that I wanna do it via adding some codes to my code that stated above.

• I think you have to use Xindy and not MakeIndex. – egreg Oct 23 '14 at 21:35
• @egreg: I check it. – Özgür Oct 23 '14 at 21:43
• Maybe you are looking for \documentclass[turkish...]{...}\usepackage{babel}? – cfr Oct 23 '14 at 23:04
• @egreg texindy improves the sort (if that's the right way to do it), but some characters are still sorted to the start of the index with numbers: İ, Ş, ş. What am I doing wrong? – cfr Oct 23 '14 at 23:34

You need to use xindy for sorting non-western languages. Try to run this command:

xindy -M texindy -L turkish -C utf8 sample.idx


I am not sure whether the sorting is correct, at least sorting of i and İ looks suspiciuos to me

• Almost there but still not correct, ö and Ö should be under separate letter. And as you noticed lower and upper case i,ü,ç and ş is wrong too. But at least they show up at the correct locations. – percusse Oct 24 '14 at 7:03
• @percusse perhaps this should be reported to xindy bug tracker by someone with knowledge of correct Turkish sorting – michal.h21 Oct 24 '14 at 7:27
• The (Iıİi)'s don't really have a solution, if your index is bilingual. If, for example, you sort under the Turkish rules, then the index entries for 'Ideal' and 'ideal' will be classified under two separate initial letters, which is confusing, independently of whether it is 'correct' or not. General indices, IMHO, should be all lowercase except for proper nouns (which perhaps should be in a separate index). But then again, that might not suit those who speak German. – Brent.Longborough Nov 30 '14 at 22:12

My (incomplete) solution with your helps

MWE

\documentclass[a4paper,10pt]{book}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\usepackage[noautomatic,nonewpage]{imakeidx}
\makeindex[columns=3]
\usepackage{filecontents}
\begin{filecontents}{\jobname.mst}
delim_0 "\\dotfill"
delim_1 "\\dotfill"
delim_2 "\\dotfill"
\end{filecontents}

\begin{document}

\index{Apple} A \index{Blackberry}\index{Current}\index{Çay}\index{çay}
\index{Date}\index{Eggplant}\index{Fake}\index{Grape}\index{History}
\index{Ilımlı}\index{İzmir}\index{ideal}\index{Jackfruit}
\index{Kitchen}\index{Lemon}\index{Mango}\index{Narrow}
\index{Over}\index{Özgür}\index{özel}\index{Pear}\index{Raspberry}
\index{Satsuma}\index{Şimşek}\index{şimşek}\index{Tomato}
\index{Yes}\index{Zebra}\index{70}

\printindex

\end{document}


Then

1) (If not installed)

sudo apt-get install xindy

2) First, LaTeX to PDF

3)

texindy -L turkish -M lang/turkish/utf8 sample.idx

4) Last, LaTeX to PDF

Why incomplete? Because \dotfill, symhead_positive, and numhead_positive are disappearing. Again with your help I understood that the solution is hidden in it.

begin{filecontents*}{\jobname.xdy}

...

\end{filecontents*}

Next Question : Lost \dotfill After The texindy command