13

For an appendix I want a page numbering which goes like A1, A2, ...

How to do that? With \pagenumbering{...} I can only choose between arabic and roman numbering.

24

You can change the "appearance" of the page counter by redefining \thepage. Here's a solution that simply adds "A":

\documentclass{article}

\usepackage{lipsum}

\begin{document}

\section{foo}

\lipsum

\clearpage
\pagenumbering{arabic}% resets `page` counter to 1
\renewcommand*{\thepage}{A\arabic{page}}
\appendix

\section{appfoo}

\lipsum

\end{document}

For the book and report class, you may consider to add a page number prefix according to the apendix chapter "number" ("A", "B", ...). In the following example, the etoolbox package is used to prepend the definition of \chapter at the start of the appendix:

\documentclass{report}

\usepackage{etoolbox}

\usepackage{lipsum}

\begin{document}

\chapter{foo}

\lipsum

\appendix
\pretocmd{\chapter}{%
  \clearpage
  \pagenumbering{arabic}%
  \renewcommand*{\thepage}{\thechapter\arabic{page}}%
}{}{}

\chapter{appfoo}

\lipsum

\chapter{appbar}

\lipsum

\end{document}
1
  • Nice. However, when I tried that it kinda messed up my Table of Contents. The page numbers are not properly aligned there anymore. Any suggestions? – Dietmar Haba Aug 11 '16 at 6:50
5

For the article class I use the following in the preamble to get the page numbers to be A-1, A-2...B-1, B-2, etc. so you don't have to hardwire the section letter for each appendix. Including \break makes so that each appendix starts on its own page and gets a new page numbering style according to the section A, B, C, etc.

\newcommand{\appendixpagenumbering}{
  \break
  \pagenumbering{arabic}
  \renewcommand{\thepage}{\thesection-\arabic{page}}
}

Then use this command at the beginning of each appendix section

\appendixpagenumbering

This works nicely with the figure and table renumbering commands used once at the beginning of the appendix.

\counterwithin{figure}{section}
\counterwithin{table}{section}
2
  • 1
    You could also add the clearpage, the redefinition of thepage and the pagenumbering to the definition of \appendix. Means less work and makes it more consistent. – Johannes_B Nov 7 '14 at 19:53
  • But, i think using report would be a cleaner solution considering the clearpages. Ah and yeah, welcome :-) – Johannes_B Nov 7 '14 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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