I have an index of symbols made using makeindex:




\index{sin@$\sin$}    % just some examples of index entries

\index{greek.a@$\alpha$}    % symbols with greek letters

\index{(@$(a)_n$}    % an entry with a bracket



I would like to have a letter group (subdivision) of the index for each Greek letter. (I understand I would have to specify another key and greek.a isn't going to work.) But not just for Greek letters. I also want to organize the entries under the symbols heading, for example gather those that involve round brackets ().

Question: How can I add custom letter groups to an index? (It doesn't need to be with makeindex.)


This answer is for MikTeX, I don't know about TeXLive. It can be done with xindy. My .xdy file begins:

(define-letter-group "$\alpha$" :after "default" :before "A" :prefixes ("\235\313\227\227\256\200\264\310\244\200"))
(define-letter-group "$\beta$" :after "$\alpha$" :before "A" :prefixes ("\235\313\227\227\256\204\227\332\200"))

where those numbers are octal codes for "greekalpha" resp. "greekbeta" (you can choose any string you think makes sense) which I entered in Emacs not as strings but as single bites, using M-x hexl-mode C-M-o 235 etc. You can't copy them from another file, but you can copy (or find and replace) them in normal mode within the same file. The numbers themselves I got from ...\xindy\modules\lang\english\utf8.xdy. If you're having problems, this answer may help.

I then wrapped everything by defining \newcommand\greekindex[1]{\index{greek#1}} so that I can use


Note that I compile with

xindy -C utf8 -L english -M texindy -M mystylefile myfile.idx

I also used package bm and as headings I wrote \bm\alpha etc: Just change $\alpha$ in the .xdy file to $\bm\alpha$.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.