4

I would like to have page numbers set in a non-default style. (I will have several chapters A, B, C, ... and I would like the pages in Chapter A numbered A-1, A-2, ... and then the pages in Chapter B numbers B-1, B-2, etc.)

Questions: (1) Is there a package that supports such numbering? (2) Alternately (and probably more useful, since I will need to cobble several documents together but it is not that many pages altogether), is there a way to manually set the text written on the foot of a page?

PS: No, this is not by choice. This page numbering is mandated.

2
  • You didn't say whether you have a choice in the matter, but I personally find this method of page numbering infuriating because it makes searching for a particular page quite difficult, since it's no longer possible to predict how much deeper in the document page N is when I'm on page M.
    – Reid
    Commented Aug 1, 2011 at 18:58
  • I don't understand your question (2). Do you want to place the page number in a special position? Commented Aug 1, 2011 at 19:22

1 Answer 1

5

You need to redefine the representation for the chapter counter (to use Alphabetic characters), the representation for the page numbers (to include the chapter counter), and make sure that the page counter will reset when the chapter counter is stepped. A little example:

\documentclass{book}
\usepackage{etoolbox}
\usepackage{lipsum}

\renewcommand\thechapter{\Alph{chapter}}% change chapter counter to Alphabetic
\renewcommand\thepage{\thechapter--\arabic{page}}% change page counter (Chapter--page)
\makeatletter
\patchcmd{\@chapter}{\chaptermark{#1}}{\chaptermark{#1}\refstepcounter{page}}{}{}
\@addtoreset{page}{chapter}% resets the page counter when chapter counter is stepped
\makeatother

\begin{document}

\chapter{Test chapter one}
\lipsum[1-8]
\chapter{Test chapter two}
\lipsum[1-8]

\end{document}
3
  • I understand what \@addtoreset does in your MWE, but could you elaborate on \refstepcounter?
    – lockstep
    Commented Aug 1, 2011 at 19:07
  • 2
    @lockstep: only using \@addtoreset the page numbering will be A-0, A-1,..., B-0, B_1, so I had to step the page counter every time a new chapter is created (and I did it patching \@chapter). Commented Aug 1, 2011 at 19:10
  • I should have said "I think I understand what \@addtoreset does" ...
    – lockstep
    Commented Aug 1, 2011 at 19:12

You must log in to answer this question.

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