<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
&gt; I don't understand -- how can the order be wrong if the names are all<br>&gt; the same? :)  But if you mean, relative to other ("non-architect")<br>&gt; entries, then the problem is again with non-expanding \name, because<br>&gt; makeindex sorts the string "\name" instead of what this macro stands<br>&gt; for.<br><br>&gt; \makeatletter<br>&gt; <br>&gt; \newtoks\arch@name<br>&gt; \newtoks\arch@loc<br>&gt; <br>&gt; \def\architect#1{%<br>&gt;   \arch@name={#1}%<br>&gt;   \@getoptionalarg\finisharchitect<br>&gt; }<br>&gt; <br>&gt; \def\finisharchitect{%<br>&gt;   \arch@loc=\expandafter{\@optionalarg}%<br>&gt;   \ifx\@optionalarg\empty<br>&gt;     % No optional argument present.<br>&gt;     \expandafter\sidx\expandafter{\the\arch@name}<br>&gt;   \else<br>&gt;     % One was present.<br>&gt;     \edef\temp{architects!\the\arch@name, {\noexpand\it \the\arch@loc}}%<br>&gt;     \expandafter\sidx\expandafter{\temp}%<br>&gt;     \edef\temp{\the\arch@name, {\noexpand\it architect, \the\arch@loc}}%<br>&gt;     \expandafter\sidx\expandafter{\temp}%<br>&gt;   \fi<br>&gt; }<br>&gt; <br>&gt; \resetatcatcode<br><br>I've just noticed that there is something not quite right here.<br><br>If you run TeX on<br><br>\architect{Smith, John}<br><br>\architect{Smith}<br><br>the index is correctly typeset as<br><br>Smith, 1<br>Smith, John, 1<br><br>However, if you include the optional argument<br><br>\architect{Smith, John}[London]<br><br>\architect{Smith}[London]<br><br>then the index is incorrectly typeset<br><br>Smith, John, architect, of London, 1<br>Smith, architect, of London<br><br>Any ideas how I can sort this out?<br><br>TIA<br>Adam.<br><br /><hr />Share your photos with Windows Live Photos – Free.  <a href='http://clk.atdmt.com/UKM/go/134665338/direct/01/' target='_new'>Try it Now!</a></body>
</html>