Q and A in table of contents

In a FAQ (Frequently Asked Questions) document, the questions and answers form the bulk of the content. When a FAQ grows large, perhaps with several divisions, it needs a table of contents to help the reader locate the question they need an answer to. In such cases, it should be part of the main table of contents at the front of the document. The list of questions described in the section “Q and A list of questions” appears only within a qandaset and is probably not sufficient.

The DocBook stylesheets provide an option to include Q and A information in a document's table of contents. If you set the stylesheet parameter qanda.in.toc to 1, then qandaset titles, qandadiv titles, and qandaentry question elements are included in the document's table of contents. This feature was added starting in version 1.73 of the stylesheets.

Including this information in a TOC is unusual for DocBook, because the TOC normally contains only titles of hierarchical elements, and the Q and A elements are block elements. Mixing the two types of elements in a TOC might lead to odd combinations or sequences, depending on your content. For example, if your sections are numbered, and you set qanda.defaultlabel to number to number your questions, then your TOC may become a bit confusing. The same number may be used for both a section title and a question, and it is not obvious to the reader that they are different elements. You might need to change your style or do further customization to make the TOC more clear.