TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to replace a few individual page numbers in a document with mathematical expressions, like $a^0$ for page 1, $2(2)^1$ for 4, etc. I don't have a ToC or index, so I'm not concerned about the actual page numbers changing; just what's printed at the bottom of the page.

I'm not sure it's helpful, but here's a MWE. Instead of a 1 at the bottom of the page, I want $a^0$.



    Body of page, which is about exponential functions
share|improve this question
up vote 17 down vote accepted

Macro \thepage can be redefined to give the desired representation of the page number:

    \ifnum\value{page}=9 %
\section{My document}
Body of page, which is about exponential functions.\\
Reference to section \ref{sec:doc} at page \pageref{sec:doc}.


share|improve this answer
for a short document, marvelous! but what about a 400-page book? might be able to use some other counter for the \ifcase statement, trigger its resetting somewhere on the affected page, and have a test (in the folio code?) when the page is set to make sure it's done only once. (of course, interspersing such nonstandard page numbers in a 400-page book would make life very difficult for the reader ... but i suppose a list somewhere equating the special numbers to the nominal page numbers might soften the pain.) – barbara beeton Oct 18 '12 at 12:44

Your Answer


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.