the steps to automatically generate a table of contents are as follows:
Step one: First you need to turn the document into outline view. The following figure
Step two: Then set the heading level according to your needs
Step three: Wait until all levels are set up, we can choose the level of display, the general paper requires 3 level headings, as shown in the red box below. What we see then is the contents of the catalog.
Step four: Before the automatic generation of catalogs, you need to be aware that the location of the directory is the location of the cursor, in order to make the cover page and table of contents in the same section, to facilitate the generation of page numbers, we need to first move the cursor to the last punctuation mark on the cover sheet. Then proceed as shown in the following figure.
Step Five: Finally we find that our catalog has been generated and started from the body