How to remove the section's title from the header
1,688
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}
Related videos on Youtube
Author by
J doe
Updated on September 24, 2020Comments
-
J doe about 3 years
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}
-
Skillmon about 6 yearsThis depends on the used packages and classes. Please provide a complete MWE.
-
J doe about 6 yearsi just edit my question
-
Bernard about 6 yearsWelcome to TeX SX! This is not a full compilable code.
-
J doe about 6 yearsi just need to know to modify the text on the header
-
magula about 6 yearsPlease 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.
-
Bernard about 6 yearsJust a comment aside: your preamble loads several packages which conflict with each other (
sectsty
andtitlesec
,titletoc
andtocloft
)·
-