I have a very complicated document which cannot be easily structured. I have put considerable effort into creating an index. I was also wanting to create cross references within the text. However it strikes me that it might be possible to take specific index terms, and expand those and their sub-terms within the body text where appropriate.
For example I might have a collection of pages about events which mention persons, and also a collection of pages about persons. Without having to maintain a separate set of cross references, I would like to refer to all other pages about that person by replicating and reformatting the index entry for that person. Any hints appreciated.
LaTeXmight not be the best way to go about this. Maybe you should put your data in some kind of database and only as a final step compile someLaTeXsource code from it. This way you would also have many more flexibility in using the data, e.g. generating other documents from subsets. – canaaerus Jun 24 '12 at 6:22\person{John}which indexesPerson!John) – or something more complex, but within that range of ideas. Processing the indexing commands/files (which can be seen as@- and!-separated lists) and storing the results in new commands or a CSV list would be possible withetoolbox, but non trivial. – ienissei Jun 24 '12 at 6:59|see{x-ref}and|seealso{x-ref}features ofmakeindex. These can be added quite easily to the\personmacro suggested above. Alternatively, you may be interested in the newnameauthpackage on CTAN. – jon Jun 26 '12 at 21:24\labeland\ref. – egreg Oct 6 '12 at 23:22