I'm trying to create a table of contents in lyx, so I used \addcontentsline{toc}{chapter}{Topic} right after each heading, in ERT. However, this happens:

I have two issues: The first is that I would like to replace the text "Contents" with "Table of Contents". I would also like to add a gap between each heading and the page number, as well as a line break between successive headings. All of them are glued together in one big mess. How do I address this?
titlesecpackage) but my advice is try first the default headers style (without underlining). – Fran Mar 21 '21 at 09:14