splitLargeChapters(100000);
}
public void generateTOCFromHeadings(int depth) {
TOCEntry entry = getTOC().getRootTOCEntry();
entry.removeAll();
Iterator spine = spine();
Stack headings = new Stack();
headings.push(new TOCLevel(0, entry));
while (spine.hasNext()) {
Resource r = (Resource) spine.next();