0

I want to delete the header of the table of contents pages, to keep only the title : table of contents.

enter image description here

and this

enter image description here

my code is :

\documentclass{book}
\usepackage{fourier}
\usepackage{tikz}
\usepackage[explicit]{titlesec}
\usepackage{titletoc}
\usepackage{lipsum}
\usetikzlibrary{shadows.blur}
\usepackage{calc}
\usepackage[utf8]{inputenc}
\usepackage[frenchb]{babel}
\usepackage[french]{minitoc} 
\usepackage{titletoc} 
\usepackage{fancyhdr}

%chapter
\renewcommand\thechapter{\arabic{chapter}}

\titleformat{\chapter}
{\fontfamily{}\Huge\filleft}
{}
{20pt}
{\begin{tikzpicture}[remember picture,overlay]
    \draw [line width=2pt,blue] (-13,0) -- (1.5,0);
    \draw [line width=2pt,blue] (-13,4) -- (1.5,4);
    \draw [line width=2pt,blue] (1.5,4) -- (1.5,0);
% 
    \node[color=blue,xshift=-11cm,yshift=4.5cm,font=\fontsize{20}{20}\selectfont] {CHAPITRE}; 
% 
    \draw [fill=blue,blue,text=white] (-13,0) rectangle (-9cm,4cm)  node[pos=.5,font=\fontsize{100}{100}\fontfamily{pag}\bfseries\selectfont] {\thechapter}; % le numéro du chapitre   
    \node[anchor=north east,align=right,inner xsep=5pt,text=blue] at (2.4,4.1) 
    {\parbox{.9\textwidth}{\raggedright#1}};% le titre du partie
    \end{tikzpicture}%
}

\begin{document}
    \tableofcontents
    \chapter{A chapter}
    \section{Section}
    \section{Section 2}
    \section{test}
    \section{abc}
    \chapter{Second chapter}
    \section{Section}
    \section{Section 2}
    \section{test}
    \section{abc}
    \chapter{Second chapter}
    \section{Section}
    \section{Section 2}
    \section{test}
    \section{abc}
    \chapter{Second chapter}
    \section{Section}
    \section{Section 2}
    \section{test}
    \chapter{Second chapter}
    \section{Section}
    \section{Section 2}
    \section{test}
    \section{abc}
    \chapter{Second chapter}
    \section{Section}
    \section{Section 2}
    \section{test}
    \section{abc}
    \chapter{Second chapter}
    \section{Section}
    \section{Section 2}
    \section{test}
    \section{abc}
    \chapter{Second chapter}
\end{document}
3
  • Do you also want a blue frame for the ‘Table des Matières’?
    – Bernard
    Aug 11, 2019 at 11:14
  • no i want delet the frame . keep only the title : 'Table des Matières' in the first page only.
    – moumou85
    Aug 11, 2019 at 11:15
  • The problem with the table of contents heading is solved, but I have a problem with the headers, which would be simpler to solve with titleps than with fancyhdr
    – Bernard
    Aug 11, 2019 at 11:50

1 Answer 1

1

To format the tableofcontents heading, you can redefine the formatting of unnumbered chapters with the numberless key. As to the header, just add a \markboth{}command just after the toc command and put the whole in a group. I added the lipsum package for testing purposes, you can remove it.

\documentclass[french]{book}
\usepackage{fourier}
\usepackage{tikz}
\usepackage[explicit]{titlesec}
\usepackage{titletoc}
\usepackage{lipsum}
\usetikzlibrary{shadows.blur}
\usepackage{calc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[french]{minitoc}
\usepackage{titletoc}
\usepackage{fancyhdr}
%chapter
\renewcommand\thechapter{\arabic{chapter}}

\titleformat{\chapter}
{\fontfamily{}\Huge\filleft}
{}
{20pt}
{\begin{tikzpicture}[remember picture,overlay]
    \draw [line width=2pt,blue] (-13,0) -- (1.5,0);
    \draw [line width=2pt,blue] (-13,4) -- (1.5,4);
    \draw [line width=2pt,blue] (1.5,4) -- (1.5,0);
%
    \node[color=blue,xshift=-11cm,yshift=4.5cm,font=\fontsize{20}{20}\selectfont] {CHAPITRE};
%
    \draw [fill=blue,blue,text=white] (-13,0) rectangle (-9cm,4cm) node[pos=.5,font=\fontsize{100}{100}\fontfamily{pag}\bfseries\selectfont] {\thechapter}; % le numéro du chapitre
    \node[anchor=north east,align=right,inner xsep=5pt,text=blue] at (2.4,4.1)
    {\parbox{.9\textwidth}{\raggedright#1}};% le titre du partie
    \end{tikzpicture}%
}

\titleformat{name=\chapter, numberless}
{\fontfamily{}\Huge\filright}
{}
{0pt}
{\color{blue}#1}

\begin{document}
\bgroup
    \tableofcontents
\markboth{}
\egroup

    \chapter{A chapter}
    \section{Section}
\lipsum[1-30]
    \section{Section 2}
    \section{test}
    \section{abc}
\lipsum
    \chapter{Second chapter}
    \section{Section}
    \section{Section 2}
    \section{test}
    \section{abc}
    \chapter{Second chapter}
    \section{Section}
    \section{Section 2}
    \section{test}
    \section{abc}
    \chapter{Second chapter}
    \section{Section}
    \section{Section 2}
    \section{test}
    \chapter{Second chapter}
    \section{Section}
    \section{Section 2}
    \section{test}
    \section{abc}
    \chapter{Second chapter}
    \section{Section}
    \section{Section 2}
    \section{test}
    \section{abc}
    \chapter{Second chapter}
    \section{Section}
    \section{Section 2}
    \section{test}
    \section{abc}
    \chapter{Second chapter}

\end{document} 

enter image description here

2
  • Thank you @Bernard
    – moumou85
    Aug 11, 2019 at 14:31
  • You're welcome!
    – Bernard
    Aug 11, 2019 at 14:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .