-
-
Notifications
You must be signed in to change notification settings - Fork 676
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
front-matter main-matter page numbering #904
Comments
Presumably this may be related: |
And #562 |
@page main:left { counter-reset: page 10; } seems to work fine. |
Huh? This rule results in main pages which are numbered 10, 11, 10, 11, ... Unless the pseudo-selector Can be achieved by using your own @page main
{
counter-increment: main-pagecounter;
@bottom-center
{
font-family: Arimo, Arial, Helvetica, sans-serif;
content: counter(main-pagecounter);
}
}
article#contents a::after
{
content: target-counter(attr(href), main-pagecounter);
float: right;
} |
@page 10, that was just an example to illustrate that :left was indeed working. My suspicion is that the spec was worded as "first printed page of a document" because at that point in time, "document" was the only scope that applied to page styles, when named pages were introduced after there were multiple scopes, where the original precise wording actually creating problems when literally interpreted. It would seem to make @page whatever:first should apply to the first page occurrence of a named page style. The only possibly undefined situation that arises is what to do when a named page style is invoked, then switched to another named page style, and then back to the original named page style. Would :first apply to the second set named pages? In any case, the workaround you propose seems to work well, so that's a viable approach for me for the time being. Thanks for the help. Not sure if that should close this issue though. |
Another solution for this problem would be to have page groups, with a group for the main content and a counter reset on its first page. As this feature is tracked by #895, we can safely close this issue. |
I'm trying to create a document with a proper title page front-matter and back-matter, with properly restarting page numbering.
If I enable counter-reset: page on the page elements, with a proper encapsulating div for both front-matter and back-matter, the counter-reset is executed on every page:
matter_2.pdf
matter_2.txt
When I kludge it, with a separate empty div, I get a unwanted empty page, but the number resetting works fine:
matter_1.pdf
matter_1.txt
The other idea that came to mind is using the :first selector with my named pages, but...
@page front :first { counter-reset: page 1; }
seems to be ignored, and
@page:first front { counter-reset: page 1; }
results in the following error:
WARNING: Unsupported @page selector ":first front
", the whole @page rule was ignored at 11:1.
I'd love to hear your thoughts on this issue...
The text was updated successfully, but these errors were encountered: