fixed building of toc and index for pdf