Some years ago when I was still using Microsoft Office, I didn't know there was automatic table of contents feature. I create my table of contents manually with many dots by typing them one by one. The table of content result was very ugly. But after I knew OpenOffice.org then LibreOffice, I never use such manual way again. So how to create table of contents automatically in LibreOffice? I will show you how.
1. Create the concept of your writings. It consists of title, subtitle, sub of subtitle, etc. until the end.
2. Then select your title. Or just put your cursor there. Then click on Default Style combo box, select Heading 1.
3. Select your subtitle. Or just put your cursor there. Give it Heading 2.
4. Select your child of subtitle. Give it Heading 3.
5. Consistently, you should give Heading 2 for subtitle and Heading 3 for child of subtitle. You can give Heading 4, Heading 5, and so on for deeper subtitle, if your article has it.
6. Put your cursor at beginning of the first page.
7. Select menu Insert > Indexes and Tables > Indexes and Tables.
8. Click OK.
9. LibreOffice generates table of contents based on your headings.