@charset "utf-8"; /* * Print typography for the EBW book framework: https://github.com/electricbookworks/book-framework * Created specifically for use with PrinceXML: http://princexml.com * This stylesheet produces a B-format document including crop marks for professional printing. */ /* * Page layouts for PrinceXML */ @font-face { font-family: "Linux Libertine"; src: url(fonts/LinLibertine_R.otf); } @font-face { font-family: "Linux Libertine"; src: url(fonts/LinLibertine_RI.otf); font-style: italic; } @font-face { font-family: "Linux Libertine"; src: url(fonts/LinLibertine_RB.otf); font-weight: bold; } @font-face { font-family: "Linux Libertine"; src: url(fonts/LinLibertine_RBI.otf); font-style: italic; font-weight: bold; } @font-face { font-family: "Linux Libertine"; src: url(fonts/LinLibertine_RZ.otf); font-weight: 600; } @font-face { font-family: "Linux Libertine"; src: url(fonts/LinLibertine_RZI.otf); font-weight: 600; font-style: italic; } @font-face { font-family: "Inconsolata", monospace; src: url(fonts/Inconsolata-Regular.ttf); } @font-face { font-family: "Source Sans Pro"; src: url(fonts/SourceSansPro-Black.ttf); font-weight: 900; } @font-face { font-family: "Source Sans Pro"; src: url(fonts/SourceSansPro-BlackItalic.ttf); font-weight: 900; font-style: italic; } @font-face { font-family: "Source Sans Pro"; src: url(fonts/SourceSansPro-Bold.ttf); font-weight: 700; } @font-face { font-family: "Source Sans Pro"; src: url(fonts/SourceSansPro-BoldItalic.ttf); font-weight: 700; font-style: italic; } @font-face { font-family: "Source Sans Pro"; src: url(fonts/SourceSansPro-ExtraLight.ttf); font-weight: 200; } @font-face { font-family: "Source Sans Pro"; src: url(fonts/SourceSansPro-ExtraLightItalic.ttf); font-weight: 200; font-style: italic; } @font-face { font-family: "Source Sans Pro"; src: url(fonts/SourceSansPro-Italic.ttf); font-weight: 400; font-style: italic; } @font-face { font-family: "Source Sans Pro"; src: url(fonts/SourceSansPro-Light.ttf); font-weight: 300; } @font-face { font-family: "Source Sans Pro"; src: url(fonts/SourceSansPro-LightItalic.ttf); font-weight: 300; font-style: italic; } @font-face { font-family: "Source Sans Pro"; src: url(fonts/SourceSansPro-Regular.ttf); font-weight: 400; } @font-face { font-family: "Source Sans Pro"; src: url(fonts/SourceSansPro-Semibold.ttf); font-weight: 600; } @font-face { font-family: "Source Sans Pro"; src: url(fonts/SourceSansPro-SemiboldItalic.ttf); font-weight: 600; font-style: italic; } /* Set the initial default view when this PDF is opened. See http://www.princexml.com/forum/topic/2650/prince-pdf */ @prince-pdf { prince-pdf-open-action: none; /* none | print | command(ident) */ prince-pdf-page-layout: two-column-right; /* single-page | one-column | two-column | two-column-left | two-column-right */ prince-pdf-page-mode: show-bookmarks; /* auto | show-attachments | show-bookmarks | fullscreen */ prince-pdf-paper-tray: auto; /* auto | pick-tray-by-pdf-size */ prince-pdf-print-scaling: auto; /* auto | none */ prince-pdf-script: "" /* Insert Javascript between the quotes if needed: http://www.princexml.com/doc/properties/prince-pdf-script/ */ } /* Set up our basic page margins */ @page { size: 129mm 198mm; /* B-format matching Lightning Source available sizing */ margin-top: 15mm; margin-bottom: 20mm; margin-outside: 13mm; margin-inside: 19mm; padding: 0; marks: crop; prince-bleed: 3mm; prince-trim: 3mm; } /* Name our layouts as divs. PrinceXML needs the pages named for @page rules. */ .title-page { page: title-page; } .halftitle-page { page: halftitle-page; } .previous-publications-page { page: previous-publications-page; } .copyright-page { page: copyright-page; } .dedication-page { page: dedication-page; } .chapter { page: chapter; } .contents-page { page: contents-page; } .cover { page: cover; } .frontmatter { page: frontmatter; /* Use for any other frontmatter */ } /* Let's set running heads and footers for chapter pages only (add more if you add other layouts that need heads or footers)*/ @page chapter:left { @bottom-left { content: counter(page) "\2003" string(chapter-title, last); text-align: left; font-family: "Linux Libertine", serif; font-size: 9pt; letter-spacing: 0.025em; font-variant: prince-opentype(c2sc, smcp, onum); } } @page chapter:right { @bottom-right { content: string(section-title, last) "\2003" counter(page); text-align: right; font-family: "Linux Libertine", serif; font-size: 9pt; letter-spacing: 0.025em; font-variant: prince-opentype(c2sc, smcp, onum); } } /* But don't put footers on blank pages of a chapter (e.g. a blank verso opposite the opening recto). */ @page chapter:blank { @bottom-right { content: normal; } @bottom-left { content: normal; } } /* Start these layouts with a big top margin */ .halftitle-page, .title-page, .dedication-page, .epigraph-page, .contents-page, .chapter { margin-top: 30mm; } /* We want some layouts to start on right-hand pages only */ .frontmatter, .halftitle-page, .title-page, .dedication-page, .epigraph-page, .contents-page, .chapter { page-break-before: right; } /* For a manual page break before an element, apply this class to it */ .page-break-before { page-break-before: always; } /* For a manual page break after an element, apply this class to it */ .page-break-after { page-break-after: always; } /* To keep an element on the same page as the next element, apply this class */ .keep-with-next { page-break-after: avoid; } /* To prevent an element breaking across pages, apply this class */ .keep-together { page-break-inside: avoid; } /* * Default typography */ body { font-family: "Linux Libertine", serif; font-size: 11pt; line-height: 130%; margin: 0; padding: 0; font-variant: prince-opentype(liga); orphans: 2; /* minimum number of lines that must be left at the bottom of the first page */ widows: 2; /* minimum number of lines that must be left at the top of the second page */ prince-hyphenate-patterns: url("dictionaries/hyph.dic"); /* Specifies a local .dic file containing hyphenation patterns, relative to this CSS file. */ } h1, h2, h3, h4, h5, h6 { font-weight: normal; page-break-after: avoid; line-height: 110%; font-variant: prince-opentype(dlig); } h1 { font-size: 2.5em; string-set: chapter-title content(); } h1 strong:first-of-type { /* Useful for chapter numbers: make the number first and bold in the h1 */ display: block; margin: 0 0 0.5em 0; } h2 { margin: 1em 0 0.5em 0; padding-top: 0.5em; string-set: section-title content(); } h3 { font-size: 1.1em; margin-bottom: 0.5em; } h4 { font-size: 1em; margin-bottom: 0.5em; } p, ul, ol, dl { font-variant: prince-opentype(onum); hyphens: auto; /* Prince will add hyphens automatically */ hyphenate-after: 3; /* Minimum letters on new line after hyphen */ hyphenate-before: 3; /* Minimum letters at end of line before hyphen */ hyphenate-lines: 2; /* Maximum number of consecutive lines ending with hyphens */ } p { margin: 0; text-indent: 1em; } p:first-of-type { text-indent: 0; } sup, sub { line-height: 100%; } /* * Special classes for paragraphs */ p.first { /* A paragraph that starts a new set of paragraphs, with a gap above it. */ text-indent: 0; margin-top: 1em; /* Overridden by later rule for paragraphs after headings, blockquotes, lists and definition lists */ } p.chapter-number { font-weight: bold; font-size: 3.5em; margin: 0 0 0.66em 0; } p.source { text-align: right; max-width: 22.5em; margin: 0 0 0 25%; page-break-before: avoid; } p.valediction { text-indent: 0; margin: 1em 0; font-style: italic; text-align: right; page-break-before: avoid; } .valediction + p { text-indent: 0; /* Paragraphs after a valediction should be flush left */ } /* * Verse, poetry, lyrics */ .verse { text-indent: 0; margin: 1em 0; } .verse + p { text-indent: 0; /* Paragraphs after verse should be flush left */ } ul.verse { list-style-type: none; padding: 0; margin: 1em 0; } ul.verse li { text-indent: -2em; margin-left: 2em; } /* Finally, set flush left and override any top-margin inadvertently added with .first or similar on a paragraph after a heading, blockquote, list or definition list */ h1 + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p, blockquote + p, ol + p, ul + p, dl + p { /* Paragraphs that follow headings, blockquotes, lists, and definition lists */ text-indent: 0; margin: 0; /* Overrides margin inadvertently added by using .first or .verse on a paragraph after a heading, blockquote, list or definition list */ } /* * Bibliographies set as lists (similar in appearance to lines of verse set as a list with indented runovers */ */ .bibliography { text-indent: 0; margin: 1em 0; } .bibliography + p { text-indent: 0; /* Paragraphs after bibliographies should be flush left */ } ul.bibliography { list-style-type: none; padding: 0; margin: 1em 0; } ul.bibliography li { text-indent: -2em; margin-left: 2em; } /* * Dedications and epigraphs */ p.dedication { text-indent: 0; text-align: center; max-width: 20em; font-variant: prince-opentype(c2sc, smcp, onum); font-style: inherit; letter-spacing: 0.025em; } p.epigraph { font-style: italic; text-indent: 0; padding: 0 4em; max-width: 20em; } p.epigraph-source { text-indent: 0; padding: 0 4em; max-width: 20em; letter-spacing: 0.025em; font-variant: prince-opentype(c2sc, smcp, onum); font-style: inherit; page-break-before: avoid; } p.epigraph-source:before { content: "—"; } .epigraph-source + p, .dedication + p { /* Paragraphs after epigraphs and dedications should be flush left after space. */ text-indent: 0; margin-top: 1em; } /* Lists */ ul, ol { margin: 0 0 0.5em 0; } li > ul { margin-bottom: 0; /* manages line space after sublists in lists */ } li { margin-left: 1.33em; } li:first-of-type { page-break-after: avoid; } li:last-of-type { page-break-before: avoid; } li li:first-of-type { page-break-before:avoid; } /* Blockquotes */ blockquote { margin: 1em 0 0 0; padding: 0 1em; max-width: 35em; } blockquote p { margin: 0; padding: 0; } blockquote p:first-of-type { text-indent: 0; } blockquote p:last-of-type, blockquote ol, blockquote ul { margin: 0 0 1em 0; } /* * Definition lists. Useful for sidebar-like notes, too. */ dl { margin: 2em 0; color: grey; } dt { letter-spacing: 0.025em; page-break-after: avoid; } dd { margin: 0 0 1em 1em; } /* Definition lists used in a simple glossary */ .glossary dl, dl.glossary { color: inherit; } .glossary dt { float: left; color: inherit; } .glossary dt:after { content: ":\00a0"; } /* * Shouts and pull quotes, useful for blockquotes and definition lists */ .shout { font-size: 1.5em; font-style: italic; max-width: 20em; } *.shout, .shout * { line-height: 115%; } .pullquote { text-indent: 0; font-size: 1.5em; font-style: italic; text-align: center; margin: 0.5em 0; line-height: 115%; } .pullquote + p { text-indent: 0; } /* * Boxes */ .box { background-color: inherit; color: inherit; font-weight: inherit; font-size: inherit; border: 0.5pt solid #ccc; margin: 1em 0; padding: 1em 1em 0 1em; max-width: 38em; } p.box { padding-bottom: 1em; text-indent: 0; } .box + p { text-indent: 0; } .box h1, .box h2, .box h3, .box h4, .box h5, .box h6 { margin-top: 0; } /* * Code */ pre, code { font-family: "Inconsolata", monospace; font-size: 0.9em; white-space: pre-wrap; background-color: #f9f9f9; padding: 0.1em 0.3em; border-radius: 0.2em; } a { text-decoration: none; color: inherit; } /* * Tables */ table { border-collapse: collapse; margin: 1em 0; font-size: 80%; font-variant: prince-opentype(tnum); } th, td { border-top: 0.5pt solid #ccc; border-bottom: 0.5pt solid #ccc; border-left: 0.5pt dotted #f2f2f2; border-right: 0.5pt dotted #f2f2f2; padding: 0.15em 0.3em; } thead, th { font-weight: bold; } .table-caption { page-break-after:avoid; font-style: italic; } .table-caption em { font-style: normal; } td { vertical-align: top; page-break-inside: avoid; } td p { font-variant: prince-opentype(tnum); } thead, th, .table-subhead { page-break-after: avoid; background-color: #F2F2F2; line-height: 120%; } .table-row-stub { font-weight: bold; } td p { margin: 0; padding: 0; } /* * Figures. Note: we use the blockquote element to wrap figures and their captions in valid XHTML. * Use the .figure class for the blockquote wrapping an image and a caption. * Add .fixed, .small and/or .large for layout and size options. */ img { prince-image-resolution: 200dpi; } blockquote.figure { clear: both; float: top unless-fit; page-break-inside: avoid; background-color: inherit; font-size: inherit; font-weight: inherit; color: inherit; margin: 1em 0 1em 0; padding: 0.5em; width: 100%; box-sizing: border-box; } ol li blockquote.figure, ul li blockquote.figure { display: inline-block; /* Experimental. Effectively overrides 'unless-fit' to reduce ugly instances of indented images in lists beside floated, non-indented images. */ } .fixed, .figure.fixed { clear: both; float: none; /* For figures that must keep their position in the text flow, not float to the top of the page. */ } .figure p { clear: both; page-break-inside: avoid; page-break-before: avoid; text-align: center; } .figure p img { width: auto; max-height: 150mm; max-width: 100%; margin: 0 auto 0.5em auto; } .figure p:nth-child(2) { /* This is the caption */ padding: 0.5em 0 0 0; text-align: center; text-indent: 0; font-style: italic; } .figure p:nth-child(2) em { /* This is emphasis inside the caption */ font-style: initial; } .figure.x-small p img { width: auto; max-height: 30mm; } .figure.small p img { width: auto; max-height: 45mm; } .figure.medium p img { width: auto; max-height: 65mm; } .figure.large { float: none; page-break-before: always; } .figure.large img { max-height: 150mm; max-width: 100%; width: auto; } .logo { max-width: 10em; } /* * Footnotes */ .footnotes { margin: 2em 0 0 0; color: #555555; font-size: 0.9em; float: bottom; line-height: 130%; } .footnotes p { text-indent: 0; } .reversefootnote { display: none; } .sidenote { font-family: "Source Sans Pro"; font-weight: 300; clear: both; float: right; max-width: 10em; min-width: 5em; margin: 0.5em 0 0.5em 2em; padding: 0.5em; border-top: 0.5pt solid #eeeeee; text-indent: 0; font-size: 0.8em; font-style: inherit; line-height: 130%; } .bottom { float: bottom; max-width: 100%; margin: 1em 0 0 0; } /* * Video. Use the .videowrapper class around videos to hide them in print. */ .videowrapper { display: none; } /* * Halftitle-page and title-page */ .title-page, .halftitle-page { max-width: 20em; margin-right: auto; margin-left: auto; } .title-page { counter-reset: page 1; /* If you have a half-title page, this line will be overriden by the next */ } .halftitle-page { counter-reset: page 1; /* If the half-title page exists, this overrides the previous line */ } .title-page p { text-indent: 0; line-height: 110%; hyphens: none; max-width: 80%; } .title-page-title { font-size: 2em; margin: 20% 0 0 0; font-variant: prince-opentype(dlig, c2sc, smcp); } .title-page-subtitle { font-size: 1.5em; font-style: italic; margin: 1em 0 1em 0; font-variant: prince-opentype(dlig); } .title-page-author { font-size: 1.5em; margin: 0 0 2em 0; font-variant: prince-opentype(dlig); } .title-page-logo { width: 3em; position: absolute; bottom: 0; } /* * Copyright page */ .copyright-page { position: absolute; bottom: 0; } .copyright-page h1 { font-size: 1em; margin-bottom: 0.3em; letter-spacing: 0.025em; font-variant: prince-opentype(c2sc, smcp, onum); text-align: left; } .copyright-page p, .copyright-page li { margin: 0 0 0.5em 0; text-indent: 0; font-size: 0.8em; line-height: 120%; hyphens: none; /* Prince will not hyphenate here */ } /* * Table of Contents page. Also styles page-reference lists marked as .page-ref-list */ .contents-page { max-width: 80%; margin-left: auto; margin-right: auto; } .contents-page a::after, .page-ref-list a::after { content: leader(" ") target-counter(attr(href), page); font-variant: prince-opentype(lnum); } .contents-page ul, .contents-page ol { list-style-type: none; } .contents-page li { margin: 0 0 0.5em 0; } .contents-page li li { margin: 0; } .contents-page h2 { font-size: 1.2em; margin: 1em 0 0.5em 0; } /* TOCs in individual pages, created in kramdown with a placeholder ol/ul followed by {:toc} */ ul#markdown-toc, ol#markdown-toc { list-style-type: none; border-top: 0.5pt solid #f9f9f9; border-bottom: 0.5pt solid #f9f9f9; padding: 1em 0; margin: 2em 0; } #markdown-toc ul { list-style-type: none; margin: 0; } #markdown-toc ol { margin: 0; } #markdown-toc li { font-variant: prince-opentype(lnum); margin: 0; } #markdown-toc li li { margin-left: 1em; } #markdown-toc a { text-decoration: none; } #markdown-toc a::after { content: leader(" ") target-counter(attr(href), page); } /* * Cover-page styling. Creates a single-page low-res cover for web PDFs. */ @page cover { margin: 0; } @prince-pdf { prince-pdf-page-layout: single-page; } body.cover, div.cover { margin: 0; padding: 0; } p.cover { margin: 0; padding: 0; text-indent: 0; } img.cover { height: 100%; width: 100%; } /* * Extra typographic control */ /* Use these classes to control tracking, usually to save widows and orphans. */ .tight { letter-spacing: -0.0075em; word-spacing: -0.0075em; font-style: inherit; } .x-tight { letter-spacing: -0.01em; word-spacing: -0.01em; font-style: inherit; } .xx-tight { letter-spacing: -0.05em; word-spacing: -0.05em; font-style: inherit; } .xxx-tight { letter-spacing: -0.1em; word-spacing: -0.1em; font-style: inherit; } .loose { letter-spacing: 0.0075em; word-spacing: 0.0075em; font-style: inherit; } .x-loose { letter-spacing: 0.01em; word-spacing: 0.01em; font-style: inherit; } /* Shrink the font size */ .shrink { font-size: 0.7em; /* Useful for wide tables */ } /* Use small-cap alternate glyphs */ .smallcaps { letter-spacing: 0.025em; font-variant: prince-opentype(smcp, onum); font-style: inherit; } /* Convert both upper and lowercase to small caps (affects punctuation also) */ .allsmallcaps { letter-spacing: 0.025em; font-variant: prince-opentype(c2sc, smcp, onum); font-style: inherit; } /* Automatic fractions */ .fractions { font-variant: prince-opentype(frac); font-style: inherit; } /* To allow a break where default styles would normally avoid one. Apply the class to the parent element. */ .allow-break { page-break-before: auto; page-break-after: auto; page-break-inside: auto; } .allow-break * { page-break-before: inherit; page-break-after: inherit; page-break-inside: inherit; } /* * Hide screen-only and non-printing elements. The framework by default adds the .non-printing class to screen-only elements like #nav-bar and #footer. */ .non-printing { display: none; }