re: … have TOC for each chapter BUT not in the same file. So in the end I want to create a TOC for each chapter but out of the chapter …
I've never done it, preferring instead to have manually maintained mini-TOCs (where overall book fairly stable), or consider the FM MiniTOC feature (which I've yet to need), but what you want sounds do-able.
You'd need to create multiple Generated TOCs, and the trick would be having per-chapter Para styles so that the re-Gen only picks up the chapter content for that chapter's TOC.
Perhaps:
- Spin off & apply chapter-specific Para Catalog defs for TOC-index Paras, e.g.
Heading1 → Heading1.Ch01
Heading2 → Heading2.Ch01
- Create TOC via normal process in .book file.
- Import formats from existing TOC for which that's been worked out.
- Have it gather only the Ch##-specific Para info.
- Rename TOC.fm to TOC.Ch01.fm
- Move it in the .book to just before the Chapter.
- Revise the numbering for that Chapter to continue-from-previous for Chapter & probably page numbering.
- … repeat #2-7 for all chapters …