## LaTeX forum ⇒ MakeIndex, Nomenclature, Glossaries and Acronyms ⇒ Case sensitive sorts with makeindex

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
kaiserkarl13
Posts: 636
Joined: Tue Mar 25, 2008 5:02 pm

### Case sensitive sorts with makeindex

Is it possible to get makeindex to sort A>B>a instead of A>a>B? I'm using nomencl.sty both with and without prefixes; I've also tried setting the prefix to '+' or '=' instead of 'a' to no avail.

I can get symbols to sort ahead of all other characters, but I can't get capital letters grouped ahead of small ones.

What it looks like now:

\Gamma
\Pi
\pi
A
a
B
b
...

What I'd like:
\Gamma
\Pi
\pi
A
B
...
a
b
...

Any suggestions?

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
Could be difficult in the best case. You may try Xindy as an alternative. For Windows it is only included in the TeX Live distribution at the moment. I don't know if the upcoming version 2.8 of MiKTeX will come with it.

Best regards
Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

kaiserkarl13
Posts: 636
Joined: Tue Mar 25, 2008 5:02 pm
I figured out how to get it to work with minimal effort:

Declare symbols via
\nomenclature[*C]{$\Gamma$}{blah}

Declare upper case letters via
\nomenclature[+C]{$C$}{blah}

Declare lower case letters via
\nomenclature[-c]{$c$}{blah}

This way, the first letter of each is *, +, or - (which are sorted in that order due to their ASCII codes).

For those that use VIM, the following commands are handy for updating the upper and lower case letters:
   %s/$$nomenclature\[$$$$[A-Z]$$/\1+\2/   %s/$$nomenclature\[$$$$[a-z]$$/\1-\2/

You'll have to do the symbols manually, since those don't typically have a sorting argument (e.g., [c]). I used optional arguments like [*H], [*Y], etc. to ensure that \Psi ([*Y]) gets sorted after \Theta ([*H]).

Working example:
\nomenclature[-aa]{$a_a$}{asntoehu}%\nomenclature[*C]{$\Gamma$}{asnteohu}%\nomenclature[*H]{$\Omega$}{asnteohu}%\nomenclature[+Aa]{$A_a$}{asontehu}%\nomenclature[+AA]{$A_A$}{santoehu}%\nomenclature[+Ba]{$B_a$}{asntoehu}%\nomenclature[*Y]{$\Psi$}{asnteohu}%

which produces the order
\Gamma
\Omega
\Psi
A_A
A_a
B_a
a_a

This seems to solve the problem adequately.