Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set page number 1 start #33

Open
mrchristian opened this issue Nov 27, 2020 · 2 comments
Open

Set page number 1 start #33

mrchristian opened this issue Nov 27, 2020 · 2 comments
Labels
benchmark MVP α Must One Button Publishing MVP started 2020 vα

Comments

@mrchristian
Copy link
Contributor

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

@mrchristian mrchristian added the MVP α Must One Button Publishing MVP started 2020 vα label Nov 27, 2020
@MurakamiShinyu
Copy link

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 vivliostyle/vivliostyle.js#667 (comment)), the page counter can be reset at any document in a publication.

@MurakamiShinyu
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark MVP α Must One Button Publishing MVP started 2020 vα
Projects
None yet
Development

No branches or pull requests

2 participants