Add a template to the tabbed TOC macro

Fixes #1177