1

I have a problem with the table of contents.

When I redefine the style of the chapter, the name of the table of contents (at the top of the table) is not displayed.

If I have understand well, the style of the table of contents is defined by the style of the chapter. But it doesn't matter the style I use, it's never displayed.

Do you have any idea, what can cause that ? Is a package missing ?

\documentclass[11pt]{report}
    \usepackage[francais]{babel}
    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    \usepackage[usenames,dvipsnames]{xcolor}
    \usepackage[explicit]{titlesec}
    \usepackage{titletoc}

    \titleformat{\chapter}[block] 
      {\begin{picture}(330,180)} {%
        \put(0,230){% 
          \makebox(0,0)[lb]{%
            \colorbox[named]{Aquamarine}{\Huge \textcolor{white}{\thechapter}} 
          }
        }
        \textcolor[named]{Aquamarine}{\sc{\put(40,235){\parbox[t]{300pt}{\huge\filright #1}}}}
      } 
      {0pt}{}
      [\end{picture}]
    \titlespacing*{\chapter}{0pt}{50pt}{-200pt}

    \begin{document}
      \tableofcontents
      \chapter{TestChapter}
      \section{TestSection}
      \chapter{Test}
    \end{document}

enter image description here enter image description here

1

You should use the numberless key since the table of contents is a numberless chapter, like this:

\titleformat{name=\chapter, numberless}[block]{...}{}{0pt}{...}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.