Pandoc table of contents only works in templates