Health-Sprints / A-Machine

A-Machine
GNU General Public License v3.0
1 stars 0 forks source link

Set page number 1 start #33

Open mrchristian opened 3 years ago

mrchristian commented 3 years ago

All formats need page one to be set as the title page. This is an issue where a front cover is included.

MurakamiShinyu commented 3 years ago

If we want the page counter starting with 0 for the very first page (front cover), we can reset the page counter in the stylesheet as follows:

@page :first {
  counter-reset: page -1;
}

and when we support @page :nth(1) (see https://github.com/vivliostyle/vivliostyle.js/issues/667#issuecomment-738020563), the page counter can be reset at any document in a publication.

MurakamiShinyu commented 3 years ago

Now, Vivliostyle.js v2.5.0 supports the :nth() page selector.

See #700 feat(core): Support the :nth() page selector

You can use @page :nth(1) { counter-reset: page; } to reset the page counter at each or a specific document in a web book.

Test sample:

or see https://raw.githack.com/vivliostyle/vivliostyle.js/master/packages/core/test/files/index.html#Nth_page_selector