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.
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}
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}
thepage
and the pagenumbering to the definition of \appendix
. Means less work and makes it more consistent.
Nov 7, 2014 at 19:53