How to Create a Custom Table of Contents with Subtitles and Page Numbers in Word
Question details
The user wants to generate a custom Table of Contents (TOC) with specific formatting, such as inline subtitles separated by commas and parenthetical page numbers.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Preparing a uniquely formatted document or summary where the standard Table of Contents structure does not meet specific editorial or styling guidelines.
- Observed behavior
- Microsoft Word cannot automatically generate a Table of Contents with same-line subtitles separated by commas and page numbers enclosed in parentheses; it defaults to hierarchical, multi-line formatting without custom punctuation.
Review your document to ensure all section titles and subtitles are finalized and marked with consistent Heading styles, as manual edits to a Table of Contents can be easily overwritten upon updating.
Use Standard Table of Contents Formatting with Heading Styles
The most reliable method is to use standard built-in TOC formatting by utilizing Heading 1 and Heading 2 styles, and applying minor manual adjustments at the final stage.
While Word cannot automatically insert commas and inline subtitles in its automated TOC, using standard heading styles ensures your page numbers remain accurate. You can make layout adjustments manually right before saving the final version.
Highlight your main headings and apply the 'Heading 1' style from the Home tab. Apply 'Heading 2' to any subtitles you want included.
Navigate to the 'References' tab, click on 'Table of Contents', and select 'Custom Table of Contents' at the bottom of the dropdown menu.
Ensure that the 'Show levels' setting includes your chosen heading levels. Uncheck 'Right align page numbers' if you want numbers closer to the text, then click 'OK' to insert the TOC.
Once generated, place your cursor at the beginning of a Heading 2 subtitle and press 'Backspace' to pull it onto the same line as the Heading 1 entry. Type a comma to separate them, and manually type parentheses around the page numbers.

Create a Manual TOC using PAGE and REF Fields
For exact formatting (same-line subtitles and parenthetical page numbers) that won't be overwritten by a TOC refresh, you can manually build a summary using cross-reference fields.
Easily Manage and Customize Table of Contents with WPS Writer
WPS Writer offers a highly intuitive and flexible Table of Contents generation tool. It perfectly supports all standard Word document formats and lets you efficiently modify styles, update page numbers, and manage complex document layouts.
- 1. Apply Standard Headings: Open your document in WPS Writer and apply standard Heading styles from the Home tab to your titles and subtitles.
- 2. Access the TOC Tool: Navigate to the 'References' tab on the top ribbon and click on the 'Table of Contents' button.
- 3. Insert and Customize: Select 'Insert Table of Contents' to customize the heading levels, tab leaders, and overall formats before clicking 'OK'.
- 4. Update Easily: To update page numbers or headings after editing your document, simply right-click the TOC and select 'Update Field'.

Frequently Asked Questions
Can Microsoft Word automatically format subtitles on the same line in a Table of Contents?
No, Word's built-in Table of Contents feature automatically places different heading levels on separate lines. To achieve same-line subtitles, you must manually edit the generated TOC or use custom REF and PAGE fields.
How do I put page numbers in parentheses in the Table of Contents?
The automatic TOC generator does not support adding parentheses around page numbers out of the box. You will need to manually type parentheses around the page numbers in the generated TOC before printing or exporting, or build a manual summary list using PageRef fields.
Why does my customized Table of Contents revert to its original format when updated?
When you click 'Update entire table', the word processor regenerates the TOC based strictly on the assigned Heading styles, wiping out any manual typing or formatting (like adding commas or parentheses). To preserve manual edits as long as possible, only choose 'Update page numbers only'.
What are REF and PAGE fields used for?
REF and PAGE (or PageRef) fields are dynamic codes used to insert cross-references to bookmarks or specific headings. They allow you to manually construct highly customized lists and summaries that point to specific text or page numbers anywhere in your document.




