I would like to have on each page the range of sections covered by it displayed, opposite of the page number and accompanied by the name of the first new section (if there is a new one) starting on that page. Chapters may start on odd or even pages. I also would like the first page of a chapter to have the exact same style: with the section range next to the the inner header margin and the page number next to the outer margin. In case there is no "first" section on the first (couple of) pages of a chapter, only the page number should display in the header.
This question is closely related to this question about correctly displaying section numbers in a header; I think that a correct solution might be dependent on the information given in the answers there.
I always use the memoir
-package.
Format example: With the following code
\documentclass[openany]{memoir}
\usepackage{lipsum}
\begin{document}
\chapter{The only chapter} \lipsum[1]
\section{Section one} \lipsum[1]
\section{Section two} \lipsum[1-2]\lipsum[4]\lipsum[4]\lipsum[4]
\section{Section three} \lipsum[1]\lipsum[1]\lipsum[1]
\section{Section four} \lipsum[1]\lipsum[1]\lipsum[1]
\section{Section five} \lipsum[2]
\section{Section six} \lipsum[1]
\section{Section seven} \lipsum[1]
\section{Section eight} \lipsum[1]
\section{Section nine} \lipsum[1-5]
\section{Section ten} \lipsum[1]
\section{Section eleven} \lipsum[1-8]
\chapter{The second chapter} \lipsum[1-10]
\section{Section one} \lipsum[1]
\chapter{The third chapter}
\section{Section one} \lipsum[4]
\section{Section two} \lipsum[4]
\section{Section three} \lipsum[4]
\end{document}
chapter 2 starts on page 10 (not page 11, thanks to the openany
option), chapter 3 starts on page 13 (not page 15, for the same reason), and the headers should be as follows:
1.1 -- Section one
-1
2
-Section two -- 1.2
1.3--1.4 -- Section three
-3
4
-Section five -- 1.4--1.5
1.6--1.8 -- Section six
-5
6
-Section nine -- 1.9
1.9--1.11 -- Section ten
-7
8
-1.11
1.11
-9
10
--
11
12
-Section one -- 2.1
3.1--3.3 -- Section one
-13
A slight variation would be to have chapter-initial pre-section pages display only the chapter number. That would change pages 10 and 11 to the following:
[10.] 10
- 2
(German style: 10
- 2.
)
[11.] 2
- 11
(German style: 2.
- 11
)
Another (very reasonable and arguably better) variation is to have a section's name be mentioned even if there is no new section on a particular page; this is what Heiko Oberdiek's present solution does:
[8.] 8
- Section eleven -- 1.11
[9.] 1.11 -- Section eleven
- 9
Two very friendly notes for the inevitable person wanting to tell me that first pages of chapters "shouldn't" have headers:
- Written material contains so many redundancies (page numbers, tables of contents, indexes, content redundancies in the material in the body text, ...) and headers are themselves technically redundant. Consistency is my personal design choice.
- There are genres where aesthetic considerations are very much subordinate to stylistic uniformity, such as certain legal documents. (But then I don't think that a within-chapter header and footer style for a chapter's first page is unaesthetic in the first place.)
openany
as an argument to the class will let chapters start on either odd or even pages. Can't help with the rest, I'm afraid.