reset lengths for screen display

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

reset lengths for screen display