#table of contents issues with `titlesec`

1 messages · Page 1 of 1 (latest)

inner moon
#

hi, I'm having some problem with seciton formatting uisng the titlesec package; I have this in my preamble to format section, although the line break is messing with the table of contents and unnumbered sections. How can i keep the line break in numbered sections but not have it be a problem for the ToC?

    \titleformat{\section} % section formatting
    {\scshape\centering}
    {\Large Part~\thesection}
    {0pt}
    {\scshape\Large\\}
    [\vspace{0.5ex}\rule{3cm}{0.4pt}]```
#

if it helps I'm on overleaf and using the extarticle class