A table of contents item is a paragraph or a line of text displayed as a table of contents in a document. Therefore, if you want to display the table of contents automatically, you must first define the table of contents items.
The definition of a directory entry is very simple. Click View → Outline to switch to outline mode. In outline mode, the level of each paragraph in the document is clearly displayed. Select the title of the article, which is defined as "1 level". Then select the text that needs to be set as a directory item in turn, and define it as "secondary" one by one. Of course, if necessary, you can continue to define "three-level" directory entries.
After the definition is completed, click View → Page to return to page mode, insert the cursor in the document where the directory is to be created, and then perform Insert → Reference → Index and Directory again, open the interface of index and directory, and click the Directory tab.
The above * * * only defines two levels of directory items, so the number in the "display level" in the above figure is changed to "2". Show Page Numbers and Align Page Numbers Right are two recommended options. The former is used to automatically display the page where the directory item is located, and the latter is used to display beauty. Tab leader is the display symbol of the area between the directory item and the right-aligned page number, which can be selected from the drop-down list; In addition, there are a variety of directory display formats to choose from, which can be seen by pulling down "Format".
Finally, click OK, as shown in the figure, the table of contents is generated, including the page number, which is automatically displayed. Hold down the Ctrl key and click a directory item, and the current page will automatically jump to the page number where the directory item is located.