Write TOC to the correct .toc file