2

This question is a follow up to my previous one.

I am writing a book in Hebrew. I want the mainmatter of the book to have the following style in the headers and footers.

  • nothing to be printed in the footer - (\fancyfoot{})
  • page number on the Even-Right and Odd-Left pages - \fancyhead[ER,OL]{\thepage}
  • book title on the even pages, close to the page number
  • chapter number, the word chapter (translated to Hebrew) and chapter title on the odd pages, close to the page number (called with \thechapter)

My document at the moment reads the following

\documentclass{book}

%%
\usepackage{fancyhdr}
\renewcommand{\chaptermark}[1]{\markboth{\chaptername \ \thechapter \ #1}{כותרת הספר}}

\fancypagestyle{mainmatterstyle}{%
   \fancyfoot{}
   \fancyhead{}
   \fancyhead[ER]{\makebox[3em][r]{\textbf{\thepage}}\rightmark}
   \fancyhead[OL]{\leftmark\makebox[3em][l]{\textbf{\thepage}}}
}
%%
\usepackage{blindtext}
%%
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setmainfont{Arial}

\title{כותרת הספר}

\begin{document}
\frontmatter
\maketitle
\tableofcontents
\mainmatter
\pagestyle{mainmatterstyle}
\Blinddocument
\end{document}

Output: screenshot

On page 2 here you can see that the header has the section in it (unwanted, I want the book title to be printed there) and on page 3 here you can see that the chapter number and title are printed (good).

I checked the answer by Jasper Habicht and it worked just fine in an English document.

Any ideas on how to fix this?

1 Answer 1

2

Your sections still (by default) set \sectionmark, which puts the section title in \rightmark. You can eliminate this setting by switching off this sectionmark with

\renewcommand{\sectionmark}[1]{}

enter image description here

You must log in to answer this question.

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