1

I changed code from \thickhrulefill to \myrule[line width = 2.5mm]{fast cap reversed}{fast cap reversed} ; The chapter header looks good but the table of content doesn't match it. the line length is not great (it would be nice if i can increase the length of that rule)

Here is what i tried to do but it doesn't look good :

\documentclass[a4paper,french,12pt,openany,twoside]{report}

%%%%%Language

\usepackage[utf8]{inputenc}
\usepackage[french]{babel} 
\usepackage[T1]{fontenc}
\usepackage{charter}
\usepackage[expert]{mathdesign}
\usepackage{geometry}
\geometry{margin=57pt}

%%%%%Police
\usepackage{lmodern}% police de caractère
\usepackage{textcomp}% caractères additionnels
\usepackage[normalem]{ulem}
\usepackage{soul}

%%%%%Graphic

\usepackage{graphicx}
\usepackage{xcolor}% gestion des couleurs
\usepackage{footnote}


%%%%%Titling

\usepackage{titling}% pour le titre
\usepackage{titlesec}% pour les sections
\usepackage{titletoc}% pour la table des matières
\usepackage{fancyhdr}% pour les en-têtes
\usepackage{enumitem}

%%%%%Math

\usepackage{array}
\usepackage{amsthm,latexsym,amssymb,amsmath, amsfonts}
\usepackage{mathtools}
\usepackage{pstricks}%pour psshadowbox
\usepackage{mathrsfs}
\usepackage{verbatim}
\usepackage{shapepar}
\usepackage{calc}% syntaxe naurelle pour les calculs

\usepackage{hyperref} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{tikz}
\usetikzlibrary{arrows}

\newcommand{\myrule}[3][]{%
%    \begin{center}
        \begin{tikzpicture}%
            \draw[#2-#3, ultra thick, #1] (0,0) to (0.39\linewidth,0);
        \end{tikzpicture}%
%    \end{center}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Chapter Header

\renewcommand{\thechapter}{\Roman{chapter}}
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\@makechapterhead#1{%
     \vspace*{50\p@}%
     %\vspace*{10\p@}%
 {\parindent \z@ \centering \reset@font
     \myrule[line width = 2.5mm]{fast cap reversed}{fast cap reversed}\quad
       \normalfont\scshape \@chapapp{} \thechapter
       \quad\myrule[line width = 2.5mm]{fast cap reversed}{fast cap reversed} 
       \par\nobreak
       \vspace*{7mm}%
       \interlinepenalty\@M
       \hrule
       \vspace*{6mm}%
       \normalfont\Huge \bfseries \centering #1\par\nobreak
       \par
       \vspace*{7mm}%
       \hrule
   \vskip 40\p@
   \vskip 100\p@
 }}
   \def\@makeschapterhead#1{%
     \vspace*{50\p@}%
     %\vspace*{10\p@}%
     {\parindent \z@ \centering \reset@font
           \myrule[line width = 2.5mm]{fast cap reversed}{fast cap reversed} 
           \par\nobreak
           \vspace*{10\p@}%
           \interlinepenalty\@M
           \hrule
           \vspace*{10\p@}%
           \Huge \bfseries #1\par\nobreak
           \par
           \vspace*{10\p@}%
           \hrule
       \vskip 40\p@
       %\vskip 100\p@
     }}

\begin{document}
\tableofcontents
\chapter{Introduction}
\end{document}
2

I added an additional argument to your rule that allows to specify the width depending on the situation it is used in:

\documentclass[a4paper,french,12pt,openany,twoside]{report}
%%%%%Language
\usepackage[utf8]{inputenc}
\usepackage[french]{babel} 
\usepackage[T1]{fontenc}
\usepackage{charter}
\usepackage[expert]{mathdesign}
\usepackage{geometry}
\geometry{margin=57pt}
%%%%%Police
\usepackage{lmodern}% police de caractère
\usepackage{textcomp}% caractères additionnels
\usepackage[normalem]{ulem}
\usepackage{soul}
%%%%%Graphic
\usepackage{graphicx}
\usepackage{xcolor}% gestion des couleurs
\usepackage{footnote}
%%%%%Titling
\usepackage{titling}% pour le titre
\usepackage{titlesec}% pour les sections
\usepackage{titletoc}% pour la table des matières
\usepackage{fancyhdr}% pour les en-têtes
\usepackage{enumitem}
%%%%%Math
\usepackage{array}
\usepackage{amsthm,latexsym,amssymb,amsmath, amsfonts}
\usepackage{mathtools}
\usepackage{pstricks}%pour psshadowbox
\usepackage{mathrsfs}
\usepackage{verbatim}
\usepackage{shapepar}
\usepackage{calc}% syntaxe naurelle pour les calculs
\usepackage{hyperref} 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikz}
\usetikzlibrary{arrows}
\newcommand{\myrule}[4][]{%
        \begin{tikzpicture}%
            \draw[#2-#3, ultra thick, #1] (0,0) to (#4,0);
        \end{tikzpicture}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Chapter Header
\renewcommand{\thechapter}{\Roman{chapter}}
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\@makechapterhead#1{%
     \vspace*{50\p@}%
     %\vspace*{10\p@}%
 {\parindent \z@ \centering \reset@font
 \makebox[\linewidth]{\myrule[line width = 2.5mm]{fast cap reversed}{fast cap reversed}{0.39\linewidth}\hfill\normalfont\scshape \@chapapp{} \thechapter \hfill\myrule[line width = 2.5mm]{fast cap reversed}{fast cap reversed}{0.39\linewidth}} 
       \par\nobreak
       \vspace*{7mm}%
       \interlinepenalty\@M
       \hrule
       \vspace*{6mm}%
       \normalfont\Huge \bfseries \centering #1\par\nobreak
       \par
       \vspace*{7mm}%
       \hrule
   \vskip 40\p@
   \vskip 100\p@
 }}

\def\@makeschapterhead#1{%
     \vspace*{50\p@}%
     %\vspace*{10\p@}%
     {\parindent \z@ \centering \reset@font%
           \myrule[line width = 2.5mm]{fast cap reversed}{fast cap reversed}{.98\linewidth}%
           \par\nobreak
           \vspace*{10\p@}%
           \interlinepenalty\@M
           \hrule
           \vspace*{10\p@}%
           \Huge \bfseries #1\par\nobreak
           \par
           \vspace*{10\p@}%
           \hrule
       \vskip 40\p@
       %\vskip 100\p@
     }}

\begin{document}

\tableofcontents

\chapter{Introduction}

\end{document}

enter image description here

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.