The \pagenumber macro does not reflect the conversion attribute value within the context of front matter vs. body matter. The front matter uses Roman numerals, the body matter uses regular text.


A minimum working example to show the problem:


% See: https://tex.stackexchange.com/a/128858/2148
  % Allow text to be flush with the top
  % Stretch the text to its maximum (to place page number at very bottom)
  % Allow text to be flush with the bottom



% Use Roman numerals for the front matter
\definestructureconversionset[frontpart:pagenumber] [] [romannumerals]

% Put a coloured box around the page number

  % Right-align the page number in the footer and assume single-sided pages

  % Do not define a double-sided document environment.
  % See: https://tex.stackexchange.com/a/122349/2148
  \setupmakeup[standard][page=yes, doublesided=no]


  % Title page (front cover)
    Title page

  % Copyright page

  % Table of Contents



  \input knuth




Actual Results

The output for the front matter shows the normal page number (this is not desirable: it should be a roman numeral) beside the page number converted to a Roman numeral:

Front Matter Page Number

The output for the body matter shows the normal page number (this is desirable) beside the page number converted to a regular number:

Body Matter Page Number

Expected Results

I was expecting the page number to keep the context of the conversion value, thus showing up as a roman numeral within the \inframed macro. I am trying to accomplish the following in the front matter:

Roman Numeral within Inline Frame

If possible, I'd rather avoid creating a layer.


How can you create a page number in a \framed (or \inframed) that is formatted according to the conversion value specified by:



  • 2
    Try to create more minimal examples next time and remove unnecessary settings like \setuppapersize, \setupcolors and the makeups. A minimal example for your problem would be: \setupuserpagenumber[numberconversion=romannumerals]\starttext\pagenumber\stoptext – Marco Aug 18 '13 at 23:21
  • 1
    For different conversion of page number in front part and bodypart see this mailinglist post – Aditya Aug 19 '13 at 1:30

Short Answer

Change \pagenumber to \userpagenumber.


Lets see what is happening here. Run context --pipe and type

> \pagenumber=macro:
->\strc_counters_raw \s!userpage .

So, \pagenumber gives the raw value of the counter \s!userpage.

On the other hand,

> \userpagenumber=macro:
->\directconvertedcounter \s!userpage \empty .

so \userpagenumber gives the converted value of the counter \s!userpage.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.