I'm trying to style the page number and header text differently (ex: italics on header, but roman on page number). As far as I can tell, there is no way to do that if you are working in the same margin box (top-left, top-right, for example).
Typically, my header line looks like this:
It looks like the only way to style them differently is to place them in separate margin boxes. I'd prefer not to use the corner boxes, as they hang out over the margin instead of the text. I can move them in with some negative padding/margins, but then their placement will vary depending on the number of digits.
So I'd prefer to use top-left/top-right for the folio and top-center for the header, aligning them appropriately for the left or right pages.
But those three boxes are variable width, and I can't seem to get a fixed width out of them. Is it possible?
This doesn't work, but I'd like it to:
This would allow me to place the page number reliably aligned with the text on the left edge (regardless of digits) and reliably control the space between the page number and the header content (again, regardless of content).
Is there another way to accomplish this? (Or is there a way to style things within a "content:" property?)
Typically, my header line looks like this:
content: counter(page) " \A0 \A0 \A0 \A0 \A0 \A0" string(chapter-title);
It looks like the only way to style them differently is to place them in separate margin boxes. I'd prefer not to use the corner boxes, as they hang out over the margin instead of the text. I can move them in with some negative padding/margins, but then their placement will vary depending on the number of digits.
So I'd prefer to use top-left/top-right for the folio and top-center for the header, aligning them appropriately for the left or right pages.
But those three boxes are variable width, and I can't seem to get a fixed width out of them. Is it possible?
This doesn't work, but I'd like it to:
@page :left {
@top-left {
content: counter(page);
text-align: left;
width: 1cm;
}
@top-center {
content: string(chapter-title);
text-align: left;
}
}
This would allow me to place the page number reliably aligned with the text on the left edge (regardless of digits) and reliably control the space between the page number and the header content (again, regardless of content).
Is there another way to accomplish this? (Or is there a way to style things within a "content:" property?)
Edited by jbzech