Page 1 of 1

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

Posted: Mon Oct 24, 2022 10:50 am
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!

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

Posted: Mon Oct 24, 2022 4:06 pm
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

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

Posted: Mon Oct 24, 2022 5:01 pm
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
?

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

Posted: Mon Oct 24, 2022 6:09 pm
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

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

Posted: Tue Oct 25, 2022 3:18 pm
by DAN SEA
I'm understood, thank you, Julien!