> I don't understand -- how can the order be wrong if the names are all
> the same? :) But if you mean, relative to other ("non-architect")
> entries, then the problem is again with non-expanding \name, because
> makeindex sorts the string "\name" instead of what this macro stands
> for.
> \makeatletter
>
> \newtoks\arch <at> name
> \newtoks\arch <at> loc
>
> \def\architect#1{%
> \arch <at> name={#1}%
> \ <at> getoptionalarg\finisharchitect
> }
>
> \def\finisharchitect{%
> \arch <at> loc=\expandafter{\ <at> optionalarg}%
> \ifx\ <at> optionalarg\empty
> % No optional argument present.
> \expandafter\sidx\expandafter{\the\arch <at> name}
> \else
> % One was present.
> \edef\temp{architects!\the\arch <at> name, {\noexpand\it \the\arch <at> loc}}%
> \expandafter\sidx\expandafter{\temp}%
> \edef\temp{\the\arch <at> name, {\noexpand\it architect, \the\arch <at> loc}}%
> \expandafter\sidx\expandafter{\temp}%
> \fi
> }
>
> \resetatcatcode
I've just noticed that there is something not quite right here.
If you run TeX on
\architect{Smith, John}
\architect{Smith}
the index is correctly typeset as
Smith, 1
Smith, John, 1
However, if you include the optional argument
\architect{Smith, John}[London]
\architect{Smith}[London]
then the index is incorrectly typeset
Smith, John, architect, of London, 1
Smith, architect, of London
Any ideas how I can sort this out?
TIA
Adam.
Share your photos with Windows Live Photos – Free.
Try it Now!