{# A @page margin box. This template emits CSS, not markup -- the slot it fills lands inside the skeleton's `style` element -- so every interpolated value goes through `css_string` and never `escape_html`. HTML entities inside a stylesheet render literally, and neither filter's absence would stop a `` in a firm name closing the block early. #} {# A box that follows the section prints the named string the skeleton's section titles set (`string-set`, `string()`: print-engine features). Its label is a second string, seeded on a zero-height leaf after the cover and cleared by every section title, so it shows only on sheets before the first one -- a contents sheet -- and read with `last` so a sheet where the first section starts shows the section, not the label. #} {% if follow %} .{{ running_string }}-start { string-set: {{ running_string }}-fallback "{{ running_label | css_string }}"; } {% endif %} @page { @{{ running_box }} { content: {% if follow %}string({{ running_string }}-fallback, last) string({{ running_string }}, first){% else %}"{{ running_label | css_string }}"{% endif %}{% if show_page_number %} " ยท " counter(page) " / " counter(pages){% endif %}; font-family: {{ font.label }}; font-size: {{ size.type.micro }}px; color: {{ theme.text.light }}; } } {# ...and not on the cover. A zero margin there does NOT suppress a margin box -- it renders anyway, clipped against the page edge, which is what the first PDF showed. Only `content: none` removes it. The region that put the box somewhere is what knows which one to blank. #} @page cover { @{{ running_box }} { content: none; } } {% if skip_first %} {# The opening sheet carries no box (#400). `:first` outranks the bare rule and the count still runs, so sheet two reads 2. #} @page :first { @{{ running_box }} { content: none; } } {% endif %}