Decks rendered with civilytics-reveal and printed to PDF (reveal.js ?print-pdf, or headless Chrome Page.printToPDF) have no side margins. Titles, tables and bullets run to the page edge, even though the HTML view looks right.
reveal.js's print-pdf stylesheet then overrides section padding with !important, so the theme's padding is lost in print. Found 2026-09-25 on version 1.0.0 of the extension (civilytics 0.3.1).
Restoring the full 48px 72px in print pushed three text-dense slides of a 29-slide deck onto extra pages. 32px 56px kept every slide on one page. The print value may need to be smaller than the screen value, or a variable decks can override.
The rule belongs in quarto/extensions/civilytics-reveal/civilytics.scss.
Check the title slide and section.stack (vertical slides) after the change.
Verify by rendering to PDF and viewing the pages. The HTML view does not show the bug.
## Problem
Decks rendered with `civilytics-reveal` and printed to PDF (reveal.js `?print-pdf`, or headless Chrome `Page.printToPDF`) have no side margins. Titles, tables and bullets run to the page edge, even though the HTML view looks right.
## Cause
`civilytics.scss` pads every slide:
```scss
.reveal .slides > section,
.reveal .slides > section > section {
padding: 48px 72px;
...
}
```
reveal.js's print-pdf stylesheet then overrides section padding with `!important`, so the theme's padding is lost in print. Found 2026-09-25 on version 1.0.0 of the extension (civilytics 0.3.1).
## Fix used in a deck (deck-local CSS)
```css
html.print-pdf .reveal .slides section,
html.reveal-print .reveal .slides section {
padding: 32px 56px !important;
box-sizing: border-box !important;
}
html.print-pdf .reveal .slides section.stack,
html.reveal-print .reveal .slides section.stack {
padding: 0 !important;
}
```
## Notes for the upstream fix
- Restoring the full `48px 72px` in print pushed three text-dense slides of a 29-slide deck onto extra pages. `32px 56px` kept every slide on one page. The print value may need to be smaller than the screen value, or a variable decks can override.
- The rule belongs in `quarto/extensions/civilytics-reveal/civilytics.scss`.
- Check the title slide and `section.stack` (vertical slides) after the change.
- Verify by rendering to PDF and viewing the pages. The HTML view does not show the bug.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
Decks rendered with
civilytics-revealand printed to PDF (reveal.js?print-pdf, or headless ChromePage.printToPDF) have no side margins. Titles, tables and bullets run to the page edge, even though the HTML view looks right.Cause
civilytics.scsspads every slide:reveal.js's print-pdf stylesheet then overrides section padding with
!important, so the theme's padding is lost in print. Found 2026-09-25 on version 1.0.0 of the extension (civilytics 0.3.1).Fix used in a deck (deck-local CSS)
Notes for the upstream fix
48px 72pxin print pushed three text-dense slides of a 29-slide deck onto extra pages.32px 56pxkept every slide on one page. The print value may need to be smaller than the screen value, or a variable decks can override.quarto/extensions/civilytics-reveal/civilytics.scss.section.stack(vertical slides) after the change.jared referenced this issue2026-10-15 15:31:25 -04:00