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'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$.

\documentclass{article}

\usepackage{amsmath}

\begin{document}
    Body of page, which is about exponential functions
\end{document}
share|improve this question
add comment

1 Answer

up vote 16 down vote accepted

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

\documentclass{article}
\renewcommand*{\thepage}{%
  \ifcase\value{page}%
    0%
  \or
    $a^0$%
  \or
    $2^1$%
  \or
    3%
  \or
    $2^2$%
  \else
    \ifnum\value{page}=9 %
      $3^3$
    \else
     \arabic{page}%
    \fi
  \fi
}
\begin{document}
\section{My document}
\label{sec:doc}
Body of page, which is about exponential functions.\\
Reference to section \ref{sec:doc} at page \pageref{sec:doc}.
\end{document}

Result

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
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.