1

Header should change from "List of figures" to "Preface."

MWE:

\documentclass[a4paper,oneside,12pt]{extbook}
\usepackage[UKenglish]{babel}
\usepackage{lipsum}

\begin{document}
\renewcommand{\listfigurename}{List of figures}
\frontmatter
\listoffigures
\mainmatter

\chapter*{Preface}
\section*{Acknowledgements}
\lipsum[1-30]

\chapter{First chapter}
\section{First Section}
\subsection{Subsection}
\lipsum[1-30]
\end{document}

I also get the same issue with other book classes.

skvery
  • 597
  • 1
  • 5
  • 20
  • I have a similar problem in my document. Once you write a chapter* after having typeset the lof, the header in the new chapter* continues to be shown as list of figures. – silenstseeker Apr 04 '20 at 11:01
  • see the comment by marijn on https://tex.stackexchange.com/questions/536606/header-after-listoftables-incorrect – hkh Apr 04 '20 at 11:21
  • 1
    In this particular case (after inspecting \ps@headings in the example), I'd suggest to use \chapter*{Preface}\markright{PREFACE} or, equivalently, \chapter*{Preface}\markright{\MakeUppercase{Preface}}. – frougon Apr 04 '20 at 11:53
  • May I suggest that this is a bug? – skvery Apr 04 '20 at 14:56
  • @skvery -- It's not a bug, but a design decision. Some publishers (among them the AMS) have made a different decision and update the headers whenever the chapter or section changes, including the starred versions. – barbara beeton Apr 04 '20 at 17:07

1 Answers1

3

Here is a simple solution I found on https://en.wikibooks.org/wiki/LaTeX/Customizing_Page_Headers_and_Footers

For ultimate flexibility, the \chapter command and its friends do not redefine \rightmark and \leftmark themselves. They call yet another command (\chaptermark, \sectionmark, or \subsectionmark) that is responsible for redefining \rightmark and \leftmark, except if they are starred -- in such a case, \markboth{Chapter/Section name}{} must be used inside the sectioning command if header and footer lines are to be updated.

about \markboth see http://texblog.net/help/latex/markboth.html

so to get what you want change your example as follow

    \chapter*{Preface}
    \markboth{}{Preface}
hkh
  • 311
  • \markboth in this case should be entered as \markboth{Preface}{Preface}, otherwise the left-hand header will be blank. – barbara beeton Apr 04 '20 at 17:15
  • @barbarabeeton on left I got the page number – hkh Apr 04 '20 at 18:49
  • 1
    I meant the header text. It would nice to have that on a left-hand page if the chapter ends on that left-hand page. – barbara beeton Apr 04 '20 at 19:34
  • 1
    @barbarabeeton This is a one-sided document. In this mode, \ps@headings doesn't use the \leftmark at all. That is why I proposed to use \markright. – frougon Apr 04 '20 at 22:24
  • @frougon -- Ah, I spaced over oneside. You are correct. On the other hand, it should have been sufficient to specify \markright. – barbara beeton Apr 04 '20 at 23:08
  • @barbarabeeton Err... I don't understand your last sentence. Where did I say to use something else than \markright? – frougon Apr 04 '20 at 23:13
  • @frougon -- Oops. You are correct again. I was looking at the last bit of code in the answer to which this is a column. Apologies. (I'm trying to multiprocess, working on the next TUGboat issue. Not doing that very well, it seems.) – barbara beeton Apr 05 '20 at 00:47
  • @barbarabeeton No problem Barbara. Many thanks for your work on these gems! :-) – frougon Apr 05 '20 at 07:18