Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
1  
Please give a MWE to describe more concretely what you want to achieve. Also, the way you are stating it now, it sounds like LaTeX might 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 some LaTeX source 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
The more semantic way to handle the problem would be to create a cross-referencing command that also indexes the entry at the same time (e.g. \person{John} which indexes Person!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 with etoolbox, but non trivial. – ienissei Jun 24 '12 at 6:59
Perhaps you could explain more clearly how your requirements can't be met using the |see{x-ref} and |seealso{x-ref} features of makeindex. These can be added quite easily to the \person macro suggested above. Alternatively, you may be interested in the new nameauth package on CTAN. – jon Jun 26 '12 at 21:24
Many thanks - particularly to ienissei. I use other semantic software. Re Jon's comment - see, seealso - won't achieve what I want. The aim is to enable bypassing of the index altogether for most purposes, while avoiding the need to index twice. Imagine I am maintaining those old tomes which are an alphabetical combination of dictionary and encyclopedia. The entry for python describes a python, and at end of entry says "see also adder p5, viper p2, and other python stuff p4,8). User looks up python and then goes to related entries directly, not via index for snakes and pythons. – Aubrey Blumsohn Jun 27 '12 at 18:40
@AubreyBlumsohn From the last comment it looks like you want to use \label and \ref. – egreg Oct 6 '12 at 23:22

closed as not a real question by egreg, Joseph Wright Dec 1 '12 at 23:21

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.