i'm having an issue building the TOC for a large anthology, the book needs to have two TOCs:
The main problem is that whilst each text in the book has a title, the author must NOT be written on the text(the idea is that each text is "anonymous" until you get to the index and then you see whose author is it), thus i can't use it as a variable for the TOC!(in previous books i've done this by hand, by adding a new line below each index entry and typing the author, it's really cumbersome).
for example, ¿Can i add the author as hidden text in each title so i can reference this for the TOC?
you could add a new layer, that is set to non-printing. On that layer you could add a text frame with the autor's name where a specific paragraph style is applied that the TOC could pick up as second level.
( ACP )
after posting i was thinking about using hidden layers, that would solve the "regular" TOC.
The issue is that TOC AFAIK does not do onomastic at all.
I haven't used index function before, i'll have to research on that, i mean, i've seen the function but i have no idea how you turn the index into a TOC(with the same style), and even then i'll need to add the hidden layers a the index work on content
I did just that but now i have a serious issue: if i have to add/remove pages, the textframe on the other layer stays fixed, breaking everything and needing massive manual adjustments
i can't edit o delete my reply, i solved that with anchoring
And you could do two TOCs in the book. For that you need two distinct TOC styles.
Or you could build an index with InDesign's Index function to do the Onomastic index.
( ACP )
ok, first read through this:
And then test with a couple of names if it fits your expectation.
The result, the generated index, is formatted text where you can apply paragraph styles that could contain GREP styles if you want to tweak it visually. The main differences when compared to a TOC:
 There can be only one single index in a document or a book file vs you can have as many TOCs as you want ( with different contents if you create different TOC styles ).
 With an index you could index single or multiple words vs for every TOC entry you have to include a whole paragraph.
Because I have no idea what your Onomastic index should look like it's very hard to suggest something…
Also read through this:
Indexes and concordances
by Peter Kahrel
( ACP )
an onomastic index is based on the author or a theme for example.
the onomastic index is:
it needs to associate the pages of the same author together in that format
How should the authors be sorted?
By first appearance in the document ( book ) which is by start of the first page number?
First name first? Last name last?
An InDesign index is not very flexible when it comes to sorting.
So after generating the index you probably have to do another step with special sorting.
This could do a script.
( ACP )
In the onomastic index the authors will be sorted alphabetically by first name - last name
At the worst i'd have to sort it by hand, but at least i'll have the index built
a script would overcomplicate matters(and is waaay outside my area of expertise)
( ACP )