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.

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?

share|improve this question

4 Answers 4

up vote 10 down vote accepted

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.

share|improve this answer

Use the fmtcount package and tinker with the page counter.

\documentclass{book}

\usepackage{fmtcount}

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

\begin{document}

\addtocounter{page}{-4}

\blinddocument

\cleardoublepage
\renewcommand*{\thepage}{\hexadecimal{page}}

\blinddocument

\blinddocument

\blinddocument

\blinddocument

\end{document}
share|improve this answer

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

share|improve this answer
    
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}
share|improve this answer

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.