reset lengths for screen display

Also reset footnote counter each chapter.
Merge pull request #293 from ayr0/hotfix-toc

reset lengths for screen display
commit forgotten file
Merge pull request #294 from ayr0/refs

commit forgotten file