Summary
Generate Professional Summary with Carbone
- Template type document docx simple
- Carbone min. v4.0.0+
- Features index table
- Target index book brief
Overview
Learn how to generate professional documents with an automatic table of contents using Carbone's document generation features. This example shows you how to create well-structured documents that include an organized index, with these key features:
- Professional document layout
- Automatic table of contents
- Organized content structure
- Automatic chapter numbering
Step-by-Step Guide
Follow these simple steps to create your document with Carbone:
1. Set Up the Document Format
- Open the Microsoft Word File menu and select Page Setup
- Select a standard paper size from the available options
- For custom dimensions, use the Custom Sizes option
2. Create the Document Structure
- Use tables to maintain consistent content alignment
- Insert Carbone tags to display dynamic data, for example:
- Use
{d.chapters[i].section}for chapter titles in the first row - Use
{d.chapters[i+1]}in the second row for chapter iterations - In table properties, uncheck Allow row to break across pages to maintain consistency
- Use
- Format text and adjust spacing for better readability
- Apply appropriate Heading styles (such as Heading 1) to sections you want to include in the table of contents
3. Add the Table of Contents
- In Microsoft Word, go to the Insert menu and click the Field button
- Select Index and Tables from the Categories list
- Choose TOC in the Field names section
- Click OK to generate the table of contents
4. Manage Chapters and Subchapters Numbering
- For chapter numbering, add numbered bullets before the Carbone tag
- To number subchapters, use the :print formatter to display the loop iterator value, so it starts at 1 for each chapter.
- Since array indexes start at 0, add 1 to the iterator value. The complete formula is:
{d.chapters[i].subsections[i].category:print(..i):add(1)}
That's it! Your document will now have a professional layout with an automatic table of contents.
Related Examples
Trusted by 600+ paid customers in 40+ countries
Finance
Healthcare
Public
Retail
Industries
Energy
Software
Telecom














