1

I have an index of symbols made using makeindex:

\documentclass{article}

\usepackage{makeidx}
\makeindex

\begin{document}
Text

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

\index{greek.a@$\alpha$}    % symbols with greek letters
\index{greek.b@$\beta_{x,y}$}

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

\printindex

\end{document}

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.)

Bart Michels
  • 1,298
  • 2
  • 13
  • 24

1 Answers1

0

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

\greekindex{alpha@$\alpha$}
\greekindex{beta@$\beta_{x,y}$}

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$.

Bart Michels
  • 1,298
  • 2
  • 13
  • 24