I want to create a table of contents that looks like the one of the toc of the tcolorbox package. So I did this (MWE) :
\documentclass[12pt,a4paper]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{tikz,lipsum,lmodern}
\usepackage[most]{tcolorbox}
\newcommand{\tablemat}[1]{
\begin{tcolorbox}[enhanced,title=Table des matières,
colframe=black,colback=white,colbacktitle=black!10,
fonttitle=\bfseries,coltitle=black,attach boxed title to top center=
{yshift=-0.25mm-\tcboxedtitleheight/2,yshifttext=2mm-\tcboxedtitleheight/2},
boxed title style={boxrule=0.5mm,
frame code={ \path[tcb fill frame] ([xshift=-4mm]frame.west)
-- (frame.north west) -- (frame.north east) -- ([xshift=4mm]frame.east)
-- (frame.south east) -- (frame.south west) -- cycle; },
interior code={ \path[tcb fill interior] ([xshift=-2mm]interior.west)
-- (interior.north west) -- (interior.north east)
-- ([xshift=2mm]interior.east) -- (interior.south east) -- (interior.south west)
-- cycle;} }]
#1
\end{tcolorbox}
}
\begin{document}
\tablemat{\tableofcontents}
\chapter{a chapter}
\section{a section}
\section{a second section}
\end{document}
This creates a chapter header named "table of contents" inside the tcolorbox, and I don't want that.
How can I use this setup without creating a chapter header for the table of content ?
Thank you in advance for any advice.
\makeatletter\@startoc\makeatother
trick...)\listoffigures
and\listoftables
?