[Tex/LaTex] Defining shorttoc and toc title style

shorttoctable of contents

I've been working on a custom title presentation for my document for titles \part{}, \chapter{}, \section{} and paragraph{}. I also use the extension shorttoc to make a summary at the start of my document and then display the full table of content at the end of it.

My problem is both my shorttoc and my toc are not displayed like my other styles. I would like them to be displayed like a \part{} but I can't figure how to do it.

I've searched on the Internet and found something not similar but still with the same objective. The following code was proposed to help her solve her problem:

\makeatletter
\def\@cftmaketoctitle{\chapter*{\contentsname}}
\makeatother

I didn't find a working solution with this because the asker was using the tocloft extension and I'm using shorttoc and the normal \tableofcontents

I firstly replaced \chapter* by \part* because I would like to have my title as a \part.

Then I get trouble with \@cftmaketoctitle. I tried to compile my document with it but didn't notice any change. So I tried it by replacing it with \@shorttableofcontents and \@cftshorttableofcontents like this, without seeing any change:

\makeatletter
\def\@shorttableofcontents{\part*{\contentsname}}
\makeatother

I'm new at LaTeX programming and have trouble to understand this \@, I've understood that \def is the TeX equivalent of \newcommand in LaTeX but I struggle to go farther.

Can anyone of you help me to design my shorttoc and toc title as a part?

Here is my MWE :

\documentclass[11pt,a4paper,oneside,openright]{book}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lipsum}% Pour générer du faux texte}
\usepackage{shorttoc}% Gestion du sommaire
\usepackage{titlesec}
\usepackage[french]{babel}% Pour un document en français

% --------------------------------------------------
% Paramétrage des parties
% --------------------------------------------------
\titleclass{\part}{top}
\titleformat{\part}[frame]
    {\null\vspace{.10\textheight}\normalfont}
    {\fillright
    \enspace PARTIE~\thepart\enspace}
    {8pt}
    {\huge\bfseries\filcenter\textsc}

\titlespacing{\part}{0pt}{*0}{*5}

\renewcommand\thepart{\arabic{part}}


\begin{document}
    \part{Here is a part}
    \lipsum

    \shorttableofcontents{Sommaire}{1}

    \part*{Introduction}
    \addcontentsline{toc}{chapter}{Introduction}
    \markboth{Introduction}{Introduction}
    \lipsum

    \nocite{*}
    \printbibliography
    \addcontentsline{toc}{chapter}{Bibliographie}

    \tableofcontents
\end{document}

Best Answer

The easiest solution to the problem is to copy the \titleformat{part} and say \titleformat{chapter} with the appropiate changes. This will suffice, since \tableofcontents and \shorttableofcontents use a \chapter*{} command to write the \contentsname title.

However, this will set the style for usual \chapters as well.

Code

\documentclass[11pt,a4paper,oneside,openright]{book}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lipsum}% Pour générer du faux texte}
\usepackage{shorttoc}% Gestion du sommaire
\usepackage{titlesec}
\usepackage[french]{babel}% Pour un document en français
\usepackage{biblatex} % Most probably for \printbibliography

% --------------------------------------------------
% Paramétrage des parties
% --------------------------------------------------
\titleclass{\part}{top}
\titleformat{\part}[frame]
    {\null\vspace{.10\textheight}\normalfont}
    {\filright
    \enspace PARTIE~\thepart\enspace}
    {8pt}
    {\huge\bfseries\filcenter\textsc}

\titleclass{\chapter}{top}
\titleformat{\chapter}[frame]
    {\null\vspace{.10\textheight}\normalfont}
    {\filright
    \enspace Chapitre~\thechapter\enspace}
    {8pt}
    {\huge\bfseries\filcenter\textsc}



\titlespacing{\part}{0pt}{*0}{*5}




\renewcommand\thepart{\arabic{part}}


\begin{document}
    \part{Here is a part}
    \lipsum

    \shorttableofcontents{Sommaire}{1}

    \part*{Introduction}
    \addcontentsline{toc}{chapter}{Introduction}
    \markboth{Introduction}{Introduction}
    \lipsum

    \nocite{*}
    \printbibliography
    \addcontentsline{toc}{chapter}{Bibliographie}



    \tableofcontents
\end{document}

Sorry for bad knowledge of French ;-)

Screenshots

enter image description here enter image description here

Related Question