correct TOC to only include the last occurence of multiply-references pages, and merge titles for adjacent chapters