# Page numbers in Romannumeral in ConTeXt

I tried to change the page number into Romannumeral with

    \setuppagenumbering[conversion=romannumerals]


but it did nothing. I had to use a macro to achieve that:

    \def\RomanNumeral#1{\uppercase\expandafter{\romannumeral#1}}
\setuppagnumbering[command=\RomanNumeral]


But it is wrong, it seems that ConTeXt inserts some characters just after \romannumeral.

The first example is given in Page 88 of the manual.

-
The TeX syntax is wrong, you must remove a pair of braces: \uppercase\expandafter{\romannumeral#1} – egreg Mar 25 '13 at 12:44
– Marco Mar 25 '13 at 12:56
@egreg: I am wrong! I think I should do the exercise 7.8 and 7.9 again. – Timothy Li Mar 25 '13 at 13:39
"This is admittedly tricky; the \expandafter expands the token after the {, not the token after the group." DEK. – egreg Mar 25 '13 at 13:42
@egreg:Yeah, in fact I like plain TeX and have read the TeXbook from cover to cover, expecting the second pass:). Sometime plain TeX will take a long time, so I have to use ConTeXt now. – Timothy Li Mar 25 '13 at 14:26

To get roman page numbering in lowercase use

\setupuserpagenumber [numberconversion=romannumerals]


for upper case replace it with a capital letter:

\setupuserpagenumber [numberconversion=Romannumerals]
^


@Marco: Thanks, it works. I think the ConTeXt manual should be updated. It is too old to contain the new \setupuserpagenumber. – Timothy Li Mar 25 '13 at 14:30
Also, if you need a custom conversion macro, declare it via \defineconversion first. Then you can just hook it into any numberconversion parameter you wish -- there’s no reason to resort the command key for this. – Philipp Gesang Mar 25 '13 at 18:11