Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
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 Aug 1 '11 at 18:58
    
I don't understand your question (2). Do you want to place the page number in a special position? –  Gonzalo Medina Aug 1 '11 at 19:22
add comment

2 Answers

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}
share|improve this answer
    
I understand what \@addtoreset does in your MWE, but could you elaborate on \refstepcounter? –  lockstep Aug 1 '11 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). –  Gonzalo Medina Aug 1 '11 at 19:10
    
I should have said "I think I understand what \@addtoreset does" ... –  lockstep Aug 1 '11 at 19:12
add comment

(/usr/share/texmf-texlive/tex/latex/lipsum/lipsum.sty) ! Undefined control sequence. l.7 \patchcmd {\@chapter}{\chaptermark{#1}}{\chaptermark{#1}\refstepcounter{p...

? x No pages of output.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.