2026-10-06 06:03:55 +02:00
|
|
|
/* Print layout for PDFs from epub2md output via Pandoc + weasyprint:
|
feat: Inhaltsverzeichnis nach Cover, Titelseite und Impressum (pandoc/book.lua)
Pandocs --toc setzt Inhaltsverzeichnis und Titelkopf immer vor den
Buchtext, also vor Cover, Titelseite und Impressum.
- epub2md_merge.py: Kapiteltypen aus manifest.json; Platzhalter
<div id="epub2md-toc"> hinter dem Vorspann und, ohne eigene Titelseite,
<div id="epub2md-titlepage"> hinter dem Cover; --toc-Liste an derselben Stelle
- pandoc/book.lua (HTML/weasyprint, statt --toc): baut dort das
Inhaltsverzeichnis, lässt Pandocs Titelkopf bei eigener Titelseite weg,
Cover ohne Bildunterschrift, Kapitelanker → div.chapter-start;
andere Formate: nur Platzhalter entfernen
- print.css: jedes Kapitel (auch Cover/Titelseite/Impressum) und das
Verzeichnis auf neuer Seite, Verzeichnis mit Punktlinie und Seitenzahl
- Buch-README, Bedienungsanleitung, README: Befehle mit book.lua
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 06:27:27 +02:00
|
|
|
pandoc buch.md -s --lua-filter pandoc/book.lua --lua-filter pandoc/callouts.lua --css pandoc/print.css \
|
|
|
|
|
--pdf-engine=weasyprint -o buch.pdf
|
|
|
|
|
book.lua places the table of contents after cover, title page and imprint and marks chapter starts. */
|
2026-10-06 06:03:55 +02:00
|
|
|
@page { size: A4; margin: 2cm 1.8cm; @bottom-center { content: counter(page); font-size: 9pt; } }
|
|
|
|
|
body { max-width: none; font-size: 10.5pt; line-height: 1.4; hyphens: auto; text-align: justify;
|
|
|
|
|
font-family: "DejaVu Serif", "Liberation Serif", Georgia, serif; }
|
|
|
|
|
#title-block-header, #title-block-header h1.title { text-align: center; margin-bottom: 2em; }
|
|
|
|
|
h1, h2, h3, h4 { text-align: left; hyphens: manual; page-break-after: avoid; }
|
|
|
|
|
pre, code { font-family: "DejaVu Sans Mono", "Liberation Mono", monospace; hyphens: none; }
|
|
|
|
|
pre { background: #f6f8fa; padding: 0.5em 0.8em; border-radius: 0.3em; page-break-inside: auto; }
|
|
|
|
|
pre, pre code { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 8.5pt; } /* long code lines wrap */
|
|
|
|
|
pre { overflow: visible; }
|
feat: Inhaltsverzeichnis nach Cover, Titelseite und Impressum (pandoc/book.lua)
Pandocs --toc setzt Inhaltsverzeichnis und Titelkopf immer vor den
Buchtext, also vor Cover, Titelseite und Impressum.
- epub2md_merge.py: Kapiteltypen aus manifest.json; Platzhalter
<div id="epub2md-toc"> hinter dem Vorspann und, ohne eigene Titelseite,
<div id="epub2md-titlepage"> hinter dem Cover; --toc-Liste an derselben Stelle
- pandoc/book.lua (HTML/weasyprint, statt --toc): baut dort das
Inhaltsverzeichnis, lässt Pandocs Titelkopf bei eigener Titelseite weg,
Cover ohne Bildunterschrift, Kapitelanker → div.chapter-start;
andere Formate: nur Platzhalter entfernen
- print.css: jedes Kapitel (auch Cover/Titelseite/Impressum) und das
Verzeichnis auf neuer Seite, Verzeichnis mit Punktlinie und Seitenzahl
- Buch-README, Bedienungsanleitung, README: Befehle mit book.lua
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 06:27:27 +02:00
|
|
|
blockquote { margin: 1em 0 1em 1.5em; padding-left: 0.8em; border-left: 2px solid #ccc; color: #444; }
|
|
|
|
|
a { color: inherit; text-decoration: none; }
|
|
|
|
|
img { max-width: 100%; max-height: 24cm; height: auto; }
|
2026-10-06 06:03:55 +02:00
|
|
|
table { font-size: 9pt; }
|
feat: Inhaltsverzeichnis nach Cover, Titelseite und Impressum (pandoc/book.lua)
Pandocs --toc setzt Inhaltsverzeichnis und Titelkopf immer vor den
Buchtext, also vor Cover, Titelseite und Impressum.
- epub2md_merge.py: Kapiteltypen aus manifest.json; Platzhalter
<div id="epub2md-toc"> hinter dem Vorspann und, ohne eigene Titelseite,
<div id="epub2md-titlepage"> hinter dem Cover; --toc-Liste an derselben Stelle
- pandoc/book.lua (HTML/weasyprint, statt --toc): baut dort das
Inhaltsverzeichnis, lässt Pandocs Titelkopf bei eigener Titelseite weg,
Cover ohne Bildunterschrift, Kapitelanker → div.chapter-start;
andere Formate: nur Platzhalter entfernen
- print.css: jedes Kapitel (auch Cover/Titelseite/Impressum) und das
Verzeichnis auf neuer Seite, Verzeichnis mit Punktlinie und Seitenzahl
- Buch-README, Bedienungsanleitung, README: Befehle mit book.lua
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 06:27:27 +02:00
|
|
|
.cover { text-align: center; }
|
|
|
|
|
.cover img { max-height: 25cm; }
|
|
|
|
|
|
|
|
|
|
/* New pages: every chapter (book.lua: div.chapter-start, also cover, title page, imprint), the title
|
|
|
|
|
block, the table of contents; without book.lua every <h1>. No second break for the chapter's own <h1>. */
|
|
|
|
|
h1, .chapter-start, #title-block-header, #TOC { page-break-before: always; }
|
|
|
|
|
.chapter-start + h1, #title-block-header h1, #TOC h1 { page-break-before: auto; }
|
|
|
|
|
#TOC { page-break-after: always; }
|
|
|
|
|
|
|
|
|
|
/* Table of contents with dotted leaders and page numbers. */
|
|
|
|
|
#TOC ul { list-style: none; padding-left: 1.2em; margin: 0; }
|
|
|
|
|
#TOC > ul { padding-left: 0; }
|
|
|
|
|
#TOC li { text-align: left; }
|
|
|
|
|
#TOC a::after { content: leader(".") target-counter(attr(href), page); }
|