I am writing my final thesis, and I want to change the default page numbering like (also in TOC):
1. Introduction 1-1
1.1 Background ......... 1-1
1.1 Object ......... ... 1-2
1.1 Outline ............ 1-4
2. State of the art 2-1
2.1 Introduction ....... 2-1
2.1 Blabla ......... ... 2-4
2.1 Blabla ............. 2-18
...
Reference R-1
Appendix A A-1
Appendix B A-3
where R
and A
stand for Reference
and Appendix
respectively.
Using fancyhdr
:
\fancyhead[LE]{ \thechapter - \thepage }
\fancyhead[RO]{ \thechapter - \thepage }
Where number 5 is the first page of chapter 2 and it should be 2-1
, the second page number should be like 2-2
instead of 2-6
. Besides, the Roman page number in frontmatter
becomes like 0-XV
etc.
I have been looking through some relevant posts, but all of them can not solve this issue.
What I want is to make the whole document page numbering as Chapter No. + page No.
staring with chapter No. + 1
, and use the default Roman number for frontmatter
pages without chapter No.
So how to figure this out?
Best Answer
Redefine
\thepage
at the start of\mainmatter
, and change the definition of the internal\@chapter
macro so that it will also reset the page counter to 1 if themainmatter
switch is true. (Note that\clearpage
/\cleardoublepage
is called before\@chapter
.)EDIT: Here's an alternative if you insist on manually "numbering" your appendix chapters. Also note that your updated page numbering scheme is inconsistent (some, but not all chapters start with page [Prefix-]1).