civilytics-reveal: ordered-list numbers clip at the left edge in PDF output #27

Open
opened 2026-09-25 16:09:42 -04:00 by jared · 0 comments
Owner

Problem

In PDF output (reveal.js ?print-pdf, or headless Chrome Page.printToPDF), the numbers on ordered lists are clipped at the left edge of the slide. The HTML view shows them in full.

Cause

civilytics.scss (extension 1.0.0, civilytics 0.3.1) gives lists padding-left: 1.3em and styles ol > li::marker in the monospace font at weight 600. Two-digit and bolded monospace numerals are wider than that padding, so the marker sits partly outside the content box. In print the slide padding is also lost (see #25), so there is nothing left to absorb the overhang.

Fix used in a deck (deck-local CSS)

.reveal ol {
  padding-left: 1.6em;
  margin-left: 0.4em;
}
.reveal ol > li {
  padding-left: 0.2em;
}

Notes for the upstream fix

  • Give ol more left room than ul, sized for two-digit markers in the mono font.
  • Check it together with the fix for #25, since restoring the print padding changes how much overhang is visible.
  • Verify by rendering to PDF and viewing the pages. The HTML view does not show the bug.
## Problem In PDF output (reveal.js `?print-pdf`, or headless Chrome `Page.printToPDF`), the numbers on ordered lists are clipped at the left edge of the slide. The HTML view shows them in full. ## Cause `civilytics.scss` (extension 1.0.0, civilytics 0.3.1) gives lists `padding-left: 1.3em` and styles `ol > li::marker` in the monospace font at weight 600. Two-digit and bolded monospace numerals are wider than that padding, so the marker sits partly outside the content box. In print the slide padding is also lost (see #25), so there is nothing left to absorb the overhang. ## Fix used in a deck (deck-local CSS) ```css .reveal ol { padding-left: 1.6em; margin-left: 0.4em; } .reveal ol > li { padding-left: 0.2em; } ``` ## Notes for the upstream fix - Give `ol` more left room than `ul`, sized for two-digit markers in the mono font. - Check it together with the fix for #25, since restoring the print padding changes how much overhang is visible. - Verify by rendering to PDF and viewing the pages. The HTML view does not show the bug.
jared added the
ws
quarto
type
defect
labels 2026-09-25 16:09:42 -04:00
Sign in to join this conversation.
No labels
type
defect
ws
quarto
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Civilytics/civilyticsR#27