1
\documentclass[a4paper,12pt,towside]{book} 
\usepackage{setspace}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern,textcomp}
\usepackage[square,numbers]{natbib}
\usepackage[english,french]{babel}
\usepackage{textgreek}
\usepackage[explicit]{titlesec}
\newlength\chapnumb
\setlength\chapnumb{3cm}
 
\titleformat{\chapter}[block] {
    \normalfont\sffamily}{}{0pt} {
    \parbox[b]{\chapnumb}{
      \fontsize{120}{110}\selectfont\thechapter}
      \parbox[b]{\dimexpr\textwidth-\chapnumb\relax}{
        \raggedleft
        \hfill{\LARGE#1}\\
        \rule{\dimexpr\textwidth-\chapnumb\relax}{0.4pt}
  }
}

\titleformat{name=\chapnumb,numberless}[block]
{\normalfont\Huge\sffamily}{}{0pt}
{\parbox[b]{\chapter}{%
   \mbox{}}%
  \parbox[b]{\dimexpr\textwidth-\chapnumb\relax}{%
    \raggedleft%
    \hfill{\LARGE#1}\\
    \rule{\dimexpr\textwidth-\chapnumb\relax}{0.4pt}}}



\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\headheight}{14pt} % regler l'espace entete/paragraph
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}


\fancyhf{}
\fancyhead[RO]{\makebox[0pt][l]{
        \colorbox{teal}{\makebox[\textwidth][l]{\bfseries\textcolor{white}{\thepage}\enskip}}\hspace*{0em}}} % numéro de page dans l'en-tête alterné, \textbf : gras,
\fancyhead[LE]{\makebox[0pt][r]{
        \colorbox{teal}{\makebox[\textwidth][r]{\bfseries\textcolor{white}{\thepage}}}\hspace*{0em}}} 
\fancyhead[LO]{%
    %\textcolor{teal}
    {%
        \textbf{\chaptername~\thechapter{}. \leftmark }}}
\fancyhead[RE]{%
    %\textcolor{teal}
    {%
        \textbf{\chaptername~\thechapter{}. \leftmark}}}
\renewcommand{\headrulewidth}{0.5pt}


\usepackage[sectionbib]{chapterbib}
\addto{\captionsfrench}{\renewcommand{\bibname}{Références}}

\begin{document}

\clearpage
\bibliographystyle{unsrt}
\bibliography{bibchap3}
\end{document}

enter image description here

3
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Oct 19, 2022 at 8:40
  • In the top of page, i want write Chapitre 3. Références instead Chapitre 3. RÉFÉRENCES
    – Ouss
    Oct 19, 2022 at 8:51
  • So how are you generating these headers. Please gove a small complete document, including \documentclass, the necessary packages, and all the statements that are required to generate the picture you have given. And in the meantime look up the fancyhdr documentation and look for \nouppercase. Maybe that will give you the clue. Oct 19, 2022 at 10:45

1 Answer 1

0

The book class uses \MakeUppercase when defining the marks.

Use

\fancyhead[LO]{ \textbf{\chaptername~\thechapter{}. \nouppercase{\leftmark}}}
\fancyhead[RE]{ \textbf{\chaptername~\thechapter{}. \nouppercase{\leftmark}}}

\nouppercase is a command provided by the fancyhdr package to prevent header or footer text being typeset in uppercase.

a

Also added \usepackage[nottoc,numbib]{tocbibind} to create a numbered chapter for the references.

\documentclass[a4paper,12pt,towside]{book} 

\begin{filecontents*}{references.bib}
    @BOOK{bib1,
        author = {Donald Ervin Knuth},
        title = {The TeXbook},
        year = {1984},
        publisher = {Addison-Wesley},
        address = {London},
    }
\end{filecontents*}

\usepackage{setspace}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern,textcomp}
\usepackage[square,numbers]{natbib}
\usepackage[english,french]{babel}
\usepackage{textgreek}
\usepackage[explicit]{titlesec}

\usepackage{xcolor}

\usepackage{kantlipsum}% only dummy text <<<
\newlength\chapnumb
\setlength\chapnumb{3cm}

\titleformat{\chapter}[block] {
    \normalfont\sffamily}{}{0pt} {
    \parbox[b]{\chapnumb}{
        \fontsize{120}{110}\selectfont\thechapter}
    \parbox[b]{\dimexpr\textwidth-\chapnumb\relax}{
        \raggedleft
        \hfill{\LARGE#1}\\
        \rule{\dimexpr\textwidth-\chapnumb\relax}{0.4pt}
    }
}

\titleformat{name=\chapnumb,numberless}[block]
{\normalfont\Huge\sffamily}{}{0pt}
{\parbox[b]{\chapter}{%
        \mbox{}}%
    \parbox[b]{\dimexpr\textwidth-\chapnumb\relax}{%
        \raggedleft%
        \hfill{\LARGE#1}\\
        \rule{\dimexpr\textwidth-\chapnumb\relax}{0.4pt}}}
    
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\headheight}{14pt} % regler l'espace entete/paragraph
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}}

\fancyhf{}
\fancyhead[RO]{\makebox[0pt][l]{
        \colorbox{teal}{\makebox[\textwidth][l]{\bfseries\textcolor{white}{\thepage}\enskip}}\hspace*{0em}}} % numéro de page dans l'en-tête alterné, \textbf : gras,
\fancyhead[LE]{\makebox[0pt][r]{\colorbox{teal}{\makebox[\textwidth][r]{\bfseries\textcolor{white}{\thepage}}}\hspace*{0em}}} 
\fancyhead[LO]{ \textbf{\chaptername~\thechapter{}. \nouppercase{\leftmark}}} % changed <<<<<<<<<<
\fancyhead[RE]{ \textbf{\chaptername~\thechapter{}. \nouppercase{\leftmark}}} % changed <<<<<<<<<<

\renewcommand{\headrulewidth}{0.5pt}        

\addto{\captionsfrench}{\renewcommand{\bibname}{Références}}

\usepackage[nottoc,numbib]{tocbibind} % added <<<<<<<<<<<<<

\begin{document}        

\chapter{One}

\kant[1-3]  
    
\chapter{Two}
    
A referenced text \cite{bib1}.
    
\bibliographystyle{unsrt}
\bibliography{references}

\kant[1-10]
\end{document}
1
  • It worked, thanks a lot.
    – Ouss
    Oct 20, 2022 at 7:45

You must log in to answer this question.

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