Template:CHAPTERNAME/doc

This template returns the first field of the BOOKPAGENAME: the first field of the page name after the book name. (In some, but by no means all, books, this field is the chapter; the name of the template is therefore imperfectly descriptive, but conveniently short.)

Usage
Simply place  on a page to get the output.

Optionally specify a page as a parameter to see the output for a different page than the current one.

Internals
This template delegates the logical analysis of the page-title structure to BOOKPAGENAME.