I am writing my thesis and using a template given by my university. To get the chapter numbers in the page number, I use the following commands:
\@addtoreset{page}{chapter}
\renewcommand{\thepage}{\thechapter-\arabic{page}}
Chapter heading formating is done by using the titlesec
package. So to get new chapters in an odd page I use:
\newcommand{\chapterbreak}{\cleardoublepage}
However, the issue with this is that the last page of each chapter gets numbered with the chapter number of the next chapter. For eg. the last page of chapter 2 will be numbered 3-0
instead of 2-10
.
The way I see it, the chapter number is being incremented before the chapter break is done. Any ideas how to fix this or work around this?
Update 1: I have also tried the chappg
package which has the same problem.
Update 2: Minimum working example:
\documentclass[twoside]{report}
\usepackage{titlesec}
\usepackage{lipsum}\setlipsumdefault{1-3}
\titleclass{\chapter}{straight}
\titleformat{\chapter}[hang]{\bfseries\huge}{\thechapter\quad}{0em}{}
\newcommand{\chapterbreak}{\cleardoublepage}
\makeatletter
\@addtoreset{page}{chapter}
\renewcommand{\thepage}{\thechapter-\arabic{page}}
\makeatother
\begin{document}
\chapter{One}
\lipsum
\chapter{Two}
\lipsum
\chapter{Three}
\lipsum
\end{document}
\cleardoublepage
doesn't seem to work for some reason in my example, but the problem with the page numbering holds.
chappg
package has the same issue. – Adi Jan 24 '12 at 10:09