# Change the base of the numeration

In a document, is it possible to change the base in which the numeration is written? The default numeration is decimal, but I would like to use an octal or hexadecimal numeration for instance.

Also, when I use a document class 'book' or 'report', how can I set a negative numeration before the main text? What I mean by this is that instead of small latin numeration (i, ii, iii, iv, ...) I would like the pages to decrease with a negative sign in front. Is there a way to do so?

-

Each counter is usually printed with a macro named \thecounter where counter is the counter name, i.e. the page number is stored in the page counter and the \thepage macro is used to typeset it. The chapters use the chapter counter etc. If you want to change the base of the displayed number simple redefine this macro(s) using \renewcommand. The pgf package provides macros to display numbers in octal and hexadecimal.

If you want to start the page numbers with a negative or any other number simply set the page counter to this number using \setcounter{page}{<number>}. This should be best done in the preamble.

-

Use the fmtcount package and tinker with the page counter.

\documentclass{book}

\usepackage{fmtcount}

\usepackage[english]{babel}
\usepackage{blindtext}

\begin{document}

\blinddocument

\cleardoublepage

\blinddocument

\blinddocument

\blinddocument

\blinddocument

\end{document}

-

There is now the moreenum package that allows you to do binary, octal and hexadecimal enumeration. For example:

\documentclass{article}
\usepackage{moreenum}
\begin{document}
\begin{enumerate}[label=\enumHex*,start=8]
\item one
\item two
\item three
\end{enumerate}
\end{document}


(moreenum automatically loads enumitem so I used enumitem's start option to illustrate that this really is hex numbering, rather than having a list of >9 items...)

-
I've noticed that the original question was not about enumerate environments. But I will leave the answer here, since this shows up when searching for enumeration –  Seamus Sep 29 '11 at 14:43

As fmtcount does not work together with lastpage or totpages I had to find another solution:

\documentclass[12pt,a4paper,ngerman]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{blindtext,pgffor}
\input binhex

\begin{document}
\pagenumbering{Roman}
\tableofcontents
\newpage
\setcounter{page}{0}
\renewcommand*{\thepage}{0x\hex{\value{page}}}

\foreach \x in {0,...,4} {
\blinddocument
}

\end{document}

-