0

I'm writing my thesis and I'struggling with the header

In the header I want to have just the chapter name with no number and no "Chapter 1."

Here is what I'm using now

\documentclass[a4paper,11pt]{report}

\titleformat{\chapter}[display]
{\normalfont\bfseries}{}{0pt}{\huge}      % To supress the word "Chapter"

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyhead[C]{\leftmark}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}

Would also be nice to have the page number right and left depending on odd or even number.

Have anyone a clue?

Thank a lot.

Gio

Update

The solutions of Bernard and Pieter worked for me. I forgot to place twoside in the \documentclass option. Without twoside page number will be on the right side on each page.

2 Answers 2

1

Since you have to load titlesec, you can use the [pagestyles] option to use its companion package titleps, which makes it much simpler (no marks required):

\documentclass[a4paper,11pt]{report}
\usepackage[pagestyles]{titlesec}
\titleformat{\chapter}[block]
{\normalfont\bfseries}{}{0pt}{\centering\huge} % To suppress the word "Chapter"
\usepackage{lipsum}
\newpagestyle{mine}{%
\headrule
\sethead{}{\chaptertitle}{}
\setfoot{}{\thepage}{}
}
\pagestyle{mine}

\begin{document}

\chapter{A First Chapter}

\lipsum[1-12]

\end{document} 

enter image description here

1
  • Thanks for your help, your solution worked!
    – Gioele
    Commented Jun 6, 2021 at 8:50
0

You would have to redefine \chaptermark to only include the chapter name.

Like

\renewcommand\chaptermark[1]{\markboth{#1}{}}

Regarding the page number, use

\fancyfoot[RO,LE]{\thepage}

or

\fancyfoot[RE,LO]{\thepage}

depending on which side. If you also want to have the page numbers the same on the first page of a chapter:

\fancypagestyle{plain}{
  \fancyhead{}
  \renewcommand\headrule{}}
1
  • Work for me Thank you a lot!
    – Gioele
    Commented Jun 6, 2021 at 8:50

You must log in to answer this question.

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