The Design and Construction of eBooks, by Steve Thomas

Printing

Finally, we specify a few print controls, for anyone who wants a printed copy. This is most useful for printing from the complete (composite) file, and should produce something that looks “just like a real book”!

First add some (arbitrary) sensible constraints:

@media print {
    body {font-size:11pt; font-family:Georgia, serif; }

. . . provide a page break after each major part:

    div.halftitle,
    div.contents {
        /* page-break-before:right; */
        page-break-before:always;
    }
    div.titleverso,
    div.frontmatter,
        div.docinfo,
        div.dedication,
        div.preface,
        div.foreword,
        div.introduction,
        div.acknowledgments,
    div.chapter,
    div.act,
    div.essay,
    div.canto,
    div.backmatter,
        div.afterword,
        div.appendix,
        div.notes,
        div.glossary,
        div.bibliography,
        div.index,
        div.colophon {
            page-break-before:always;
    }
    h3,h4 { page-break-after:avoid; }

. . . force the imprint to the bottom of the title page (this doesn’t always work!):

    div.titlepage p.imprint { margin-top:60%; }

. . . and finally, fix a few “legacy” problems . . .

    div.navigation { display:none; }
    div.titlepage hr { display:none; }
    div.contents hr { display:none; }
    div.docinfo hr { display:none; }
}

We’ll also define a required page size (noting that this is not yet implemented by major browsers:

https://ebooks.adelaide.edu.au/about/part2.13.html

Last updated Tuesday, January 26, 2016 at 23:27