From 6643c37d31ceee1476a270eb55654519b306b1ca Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 14 Nov 2023 19:41:48 +0100 Subject: [PATCH] Infra: Improve print style (#3486) --- pep_sphinx_extensions/pep_theme/static/mq.css | 62 ++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/pep_sphinx_extensions/pep_theme/static/mq.css b/pep_sphinx_extensions/pep_theme/static/mq.css index 7977585e6..2609a959e 100644 --- a/pep_sphinx_extensions/pep_theme/static/mq.css +++ b/pep_sphinx_extensions/pep_theme/static/mq.css @@ -88,8 +88,12 @@ img { max-width: 100% !important; } + /* Page margins according to DIN 5008, leaves space for punched holes. */ @page { - margin: 0.5cm; + margin-top: 2cm; + margin-bottom: 2cm; + margin-left: 2.5cm; + margin-right: 2.5cm; } p, h2, @@ -102,4 +106,60 @@ h3 { page-break-after: avoid; } + h1 { + font-size: 18pt; + font-weight: bold; + text-align: center; + } + h2, details > summary { + font-size: 15pt; + font-weight: normal; + } + h3 { + font-size: 13pt; + font-weight: normal; + } + h4 { + font-size: 10pt; + font-weight: 600; + } + a, abbr { + text-decoration: none; + } + + details { + display: none; + } + details[open] { + display: block; + } + + h1.page-title:first-child { + margin-top: 0; + } + + section#pep-page-section { + display: flex; + justify-content: center; + padding: 0; + margin: 0 auto; + } + + section#pep-page-section > header, + nav#pep-sidebar { + display: none; + } + + section#pep-page-section > article { + float: none; + max-width: 17.5cm; + width: auto; + margin: 0; + padding: 0; + } + + /* This blocks a small portion on each page. */ + readthedocs-flyout { + display: none; + } }