This template generates a wiki-readable Table of Contents for a work. It is used in conjunction with {{pg}} to create page links within a work. It takes the following syntax:

{{subst:TOCIndex
|Title of Work
|1|Introduction
|12|First Chapter
|56|Second Chapter
}}

and so forth.

This template is used in conjunction with {{TOCIndex}} to generate page links within a book. First a TOC index page must be generated with {{TOCIndex}}, e.g. at Name of Book/TOCIndex. Then, this template can be used with the following syntax:

{{subst:pg|location=Name of Book/TOCIndex|page=2}}

or, more simply:

{{subst:pg|Name of Book/TOCIndex|2}}