# ToC affected by titleformat

Thanks to Bernard i was able to accomplish this look: which is what I was looking for. Though, my ToC is also affected by this: , and I would like to make my ToC look normal, like nothing has happened to it. I wrote titleformat in order to get the look from the first picture, but is there a way which configures the ToC look so that it can look normal? My coding looks like this:

\titleformat{\section}[display]{ \scshape \bfseries }{}
{3ex}

\titlespacing*{\section}{0pt}{2in}{10ex}


Thanks, and happy new year!

• \tableofcontents uses \section* (in an article - like class), your \titleformat does not take care of \section*, but is a sledge-hammer for all \section macros, \section is basically a wrapper for more code that checks whether it is the \section* or the real unstarred version of it. – user31729 Dec 31 '17 at 15:55
• A solution is to shift the \titleformat content after \tableofcontents. And please post complete code, not only fragments – user31729 Dec 31 '17 at 15:59
• Christian Hupfer's solution worked, thanks a lot. Happy New Year! – Cazo Dec 31 '17 at 16:03

The number (the label in the terminology of titlesec) belongs in the third argument of titleformat:

\RequirePackage{fix-cm}
\documentclass{article}
\usepackage{titlesec}
\usepackage[dvipsnames]{xcolor}

\titleformat{\section}
{\scshape \bfseries}
{\fontsize{149}{50}\selectfont \color{ForestGreen} \thesection}
{20pt}
{\Huge}

%\titlespacing*{\section}{0pt}{2in}{10ex}

\begin{document}
\tableofcontents
\section{abc}
blblbl

\end{document}


• Thanks a lot, this worked! My mistake, happy new year! :) – Cazo Jan 1 '18 at 2:37