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}]```