How to convert roman-style page counter numbers at the "Table of Contents" pages - into decimal format?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
DAN SEA
Posts: 59
Joined: Tue Sep 13, 2022 4:13 pm

How to convert roman-style page counter numbers at the "Table of Contents" pages - into decimal format?

Post by DAN SEA »

Hi, all!
Now I'm trying to make the numbering on the pages of the "Table of Contents" using the construction:

Code: Select all

bottom-right {
content: "Page" counter(page) "/" counter(pages);
}
However, as a result, I get the first counter in Roman numeral format and it looks something like this:

Code: Select all

Page iv/26
I tried to deal with this, as it is written here, I style it with the word "decimal", but this did not give any result.
Like this:

Code: Select all

bottom-right {
content: "Page " counter(page, decimal) "/" counter(pages);
}
And like this:

Code: Select all

bottom-right {
content: "Page " counter(page, decimal) "/" counter(pages, decimal);
}
How can this be fixed?

Thanks in advance!
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: How to convert roman-style page counter numbers at the "Table of Contents" pages - into decimal format?

Post by julien_lacour »

Hi,

The following rule should do the trick:

Code: Select all

@page table-of-contents:first:left, table-of-contents:first:right, table-of-contents:left, table-of-contents:right {
  @bottom-right {
    content: "Page " counter(page, decimal) "/" counter(pages);
  }
}
Regards,
Julien
DAN SEA
Posts: 59
Joined: Tue Sep 13, 2022 4:13 pm

Re: How to convert roman-style page counter numbers at the "Table of Contents" pages - into decimal format?

Post by DAN SEA »

Thank you, Julien. It's works fine !
Can you explain me, what doing this string (even just in a couple of words):

Code: Select all

@page table-of-contents:first:left, table-of-contents:first:right, table-of-contents:left, table-of-contents:right
?
julien_lacour
Posts: 665
Joined: Wed Oct 16, 2019 3:47 pm

Re: How to convert roman-style page counter numbers at the "Table of Contents" pages - into decimal format?

Post by julien_lacour »

Hello,

Sure, this means select all the pages named "table-of-contents" (resp. the first left, the first right, the other lefts and the other rights ones).

In Paged Media CSS, it is possible to select separately the first page of a type with the :first pseudo-class and usually we have different rules for these ones, this is why I precise them in the selector.

You can check the default page definition for table-of-contents page in our user-guide.

Regards,
Julien
DAN SEA
Posts: 59
Joined: Tue Sep 13, 2022 4:13 pm

Re: How to convert roman-style page counter numbers at the "Table of Contents" pages - into decimal format?

Post by DAN SEA »

I'm understood, thank you, Julien!
Post Reply