## LaTeX forum ⇒ General ⇒ How to remove the last numbered section title in header? Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
Cham
Posts: 894
Joined: Sat Apr 02, 2011 4:06 pm

### How to remove the last numbered section title in header?

I'm writing a book with several chapters and sections, and I'm using the fancyhdr package to customize the header. Each chapter ends with a special unumbered part for exercices and answers. That exercices part is shown in the ToC as an unumbered chapter. The MWE code below shows this. Everything works fine, but I noticed a glitch yesterday : in the exercices and answers part, the header is showing the last section title (see the last page of the compiled code). This shouldn't be the case. I would like to change it for the current unumbered section title, i.e. "Answers to problems" (without numbering). So how to do that ?


I suspect that I should simply add one renewcommand after the lines \chapter*{Some problems for the students} and \section*{Answers to problems} to locally change the current section title, but I don't see what command exactly. Any suggestion ?

Cham
Posts: 894
Joined: Sat Apr 02, 2011 4:06 pm
Oooh! I may already have found the solution !

Adding this command appears to solve my issue :

Is that the proper solution?

EDIT: Hmm, this is a partial solution only. As soon as I add a new chapter and new sections, the new sections doesn't have their title displayed in the header. Houston, we have a problem!
Last edited by Cham on Mon Jun 25, 2018 3:19 pm, edited 1 time in total.

Stefan Kottwitz
Posts: 9164
Joined: Mon Mar 10, 2008 9:44 pm
The proper way would be \markright, after \clearpage:

\clearpage\markright{Answers to problems}\section*{Answers to problems}

Stefan

Cham
Posts: 894
Joined: Sat Apr 02, 2011 4:06 pm
Whoa ! Thanks Stefan. It appears to work great!

I'll check the topic "solved" in a few minutes, after I'm sure my problem is fully solved.