[texhax] index entries in latex/makeindex

Lars Madsen daleif at imf.au.dk
Tue Dec 16 17:19:32 CET 2008


Zbigniew Nitecki wrote:
> In a book I am writing in latex (using makeindex to generate the index) 
> I am running into a confusing anomaly.
> 
> The following macros are among those I have to generate index entries:
> *********************************************************************************** 
> 
> \newcommand{\namerefindex}[4]{\index{#2, #1 (#3-#4)}}%prints name, date 
> in index not text
> \newcommand{\namerefsilent}[4]{#1\  #2\ (#3-#4)}%prints name, date in 
> text not index
> \newcommand{\nameref}[4]{#1\  #2\ 
> (#3-#4)\namerefindex{#1}{#2}{#3}{#4}}%prints name, date in text
> \newcommand{\namesubref}[5]{\index{#2, #1 (#3-#4)!#5}}%prints subentry 
> in index
> ************************************************************************************** 
> 
> (the usage is: \nameref{Firstname}{Lastname}{Birthdate}{Deathdate}
> and in the subref, #5 is an index entry under the entry above.
> 
> I have discovered that references made using \namerefsilent followed by 
> \namesubref
> work fine, but those generated using \nameref fail to show up in the index.
> 
> 
> Any explanation?
> 

could you make an example that we can just copy an run on our own systems?


-- 

/daleif


More information about the texhax mailing list