0

In my header right now i have the title of the chapter and the title of the current section, I would like to remove the title of the section of the header and leavejust the chapter title

used packages

\documentclass[12pt]{report}
\usepackage{array}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}
\usepackage{sectsty}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage{dcolumn,longtable,booktabs}
\usepackage{enumitem}
\usepackage[utf8x]{inputenc} 
\usepackage{soul}
\renewcommand{\baselinestretch}{1.5} 
\usepackage{pifont}
\usepackage{caption}
\usepackage{mathptmx}
\pagestyle{headings}
\usepackage[nottoc]{tocbibind}
\usepackage{comment}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{titlesec}
\usepackage{titletoc}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{lipsum}
\usepackage{chngcntr}\counterwithout{figure}{chapter}
\usepackage{float}
\usepackage{siunitx}
\renewcommand{\thefigure}{\arabic{figure}}
\usepackage[table]{xcolor}
\usepackage{textcomp}
\renewcommand\thesection{\Roman{section}}
\renewcommand{\headrulewidth}{0.4pt}
\sisetup{math-micro=\text{µ},text-micro=µ}
\captionsetup[table]{name=Tableau}
\sectionfont{\fontsize{12}{15}\selectfont}
\subsectionfont{\fontsize{12}{15}\selectfont}
\usepackage{tocloft}
\renewcommand{\cftsecaftersnum}{.} 
\renewcommand{\thetable}{\arabic{table}}
\usepackage[labelfont=bf]{caption}
6
  • 3
    This depends on the used packages and classes. Please provide a complete MWE.
    – Skillmon
    Sep 23, 2017 at 18:25
  • i just edit my question
    – J doe
    Sep 23, 2017 at 18:27
  • 3
    Welcome to TeX SX! This is not a full compilable code.
    – Bernard
    Sep 23, 2017 at 18:36
  • 1
    Please follow the link Skillmon gave you. As Bernard said, the code you provide should be compilable. It also should be minimal (without unnecessary parts not connected to the problem), as explained in that link.
    – magula
    Sep 23, 2017 at 21:10
  • 1
    Just a comment aside: your preamble loads several packages which conflict with each other (sectsty and titlesec, titletoc and tocloft
    – Bernard
    Sep 23, 2017 at 21:34

1 Answer 1

2

In the following suggestion I will remove all the unrelated packages and code. Especially you can remove the line \pagestyle{headings} because it is overwritten by the later \pagestyle{fancy}.

For a onesided document you can remove the left header entry:

\documentclass[12pt]{report}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}
\usepackage[utf8]{inputenc}% option replaced

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[L]{}

\usepackage{blindtext}% only for dummy text
\begin{document}
\blinddocument
\end{document}

Or you can declare the contents of the page header:

\documentclass[12pt]{report}
\usepackage[T1]{fontenc}
\usepackage[francais]{babel}
\usepackage[utf8]{inputenc}% option replaced

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{
  \fancyhead[R]{\slshape\leftmark}
}

\usepackage{blindtext}% only for dummy text
\begin{document}
\blinddocument
\end{document}

enter image description here

You must log in to answer this question.

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