1. Adjust font size: In document editing software, you can try to reduce the font size so that all long directories can be displayed in one line. You can choose an appropriate font size to make the table of contents clear and readable, and adapt to the width of a line.
2. Adjust the line spacing: appropriately reducing the line spacing can make a longer directory appear more compact in one line. You can try to reduce the value of line spacing so that the contents of the directory can fit in the space of one line.
3. Segmented display: If the directory is too long to be solved by adjusting the font size and line spacing, consider dividing the long directory into two or more segments, each of which occupies one line. This ensures the integrity of the table of contents and makes it easier to read.