[Tex/LaTex] formatting of the table of contents

formattingtable of contents

How can I change the settings of my table of contents, so that the sections and subsections are not indented as shown in the second picture. I would also like to center the title of the Contents. I am using the article class.

enter image description here

Best Answer

This is an approach which uses the »tocstyle« package with the tocflat option along with the standard style.




% Redefinition of ToC command to get centered heading



You can compare with the tocfullflat option for equidistant spaces between numbers and heading entries. More details can be found in the package manual.

N.B.: You will get a warning about the alpha status of the package. So far is has not caused any major problems for me.

enter image description here

Related Question