write document location for contents and button to open/close TOC