Hi all
1. The table of contents links
<a class="tc-tiddlylink" href="#1.1">1.1. Title...</a>
lead to anchors
<a name="#1.1"></a>
which I entered manually.
2. Each section is a transcluded tiddler with the title entered manually above it.
3. The titles are preceded by a page break for printing <p style="page-break-after: always;"> </p> and the anchor, and followed by a link back to the table of contents <a href="#toc"><span class="tiny">{{$:/core/images/home-button}}</span></a>
Looks cluttered on editing, but navigating back and forth from toc to section and back to toc is smooth. Very light at 616kb. And each section can be printed separately from the browser.
Page #s are for mainly for me, since I will print it for students who would prefer a printed version. Page #s correspond to printing on Firefox at 90%.
Not automated, and not an e-book, but I share it just to show it can be done. Blessings.