]> Shamusworld >> Repos - ardour-manual/blob - source/css/pdf.css
Align table cells on top
[ardour-manual] / source / css / pdf.css
1 /* this stylesheet is used when generating a PDF */
2 /* define a page */
3 @page {
4    size: A4;
5    margin: 1.5cm 1.5cm 1.5cm 1.5cm;
6 }
7
8 @page :first {
9         size: A4;
10         margin: 1.5cm 1.5cm 1.5cm 1.5cm;
11   background: url("../images/ardour_logo.svg") no-repeat center;
12   background-size: contain;
13 }
14
15 img {
16   max-width: 100%;
17 }
18
19 div.frontcover {
20   page-break-after: always;
21 }
22
23 /* styles for the right hand spread
24         Bottom left we display the title of the book, bottom right the page using a CSS
25   counter, top right the content of the current chapter
26 */
27 @page:right {
28    @bottom-left {
29        margin: 10pt 0 30pt 0;
30        /*border-top: .25pt solid #666;*/
31              content: "The Ardour Manual";
32        font-size: 7pt;
33        color: #333;
34    }
35    @bottom-right {
36        margin: 10pt 0 30pt 0;
37        /*border-top: .25pt solid #666;*/
38        content: counter(page);
39        font-size: 7pt;
40    }
41    @top-right {
42            content: string(doctitle);
43            margin: 30pt 0 10pt 0;
44            font-size: 7pt;
45            color: #333;
46    }
47 }
48
49 /* styles for the left hand spread
50         Bottom right book title, bottom left current page
51 */
52 @page:left {
53    @bottom-right {
54        margin: 10pt 0 30pt 0;
55        /*border-top: .25pt solid #666;*/
56              content: "The Ardour Manual";
57        font-size: 7pt;
58        color: #333;
59    }
60    @bottom-left {
61        margin: 10pt 0 30pt 0;
62        /*border-top: .25pt solid #666;*/
63        content: counter(page);
64        font-size: 7pt;
65    }
66 }
67
68 /* first page */
69 @page:first {
70   @bottom-right {
71     content: normal;
72     margin: 0;
73   }
74
75   @bottom-left {
76     content: normal;
77     margin: 0;
78   }
79 }
80
81 /* reset chapter and figure counters on the body */
82 body {
83         counter-reset: chapternum figurenum;
84         font-family: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Tahoma, sans-serif;
85         line-height: 1.2;
86         font-size: 9pt;
87 }
88
89 /* get the title of the current chapter - this will be the content of the h1
90 reset figure counter as figures start from 1 in each chapter */
91 h1 {
92   string-set: doctitle content();
93   page-break-before: always;
94   counter-reset: figurenum;
95   line-height: 1.3;
96   counter-increment: chapternum;
97 }
98
99 h1:first-of-type { /* the ToC should not count...*/
100   content: none;
101   counter-reset: chapternum;
102 }
103
104 /* increment and display figure counter */
105 figcaption:before {
106         counter-increment: figurenum;
107         content: counter(chapternum) "-" counter(figurenum) ". ";
108 }
109
110 h1,h2,h3,h4,h5 {
111         font-weight: bold;
112         page-break-after: avoid;
113         page-break-inside:avoid;
114 }
115
116 h1+p, h2+p, h3+p {
117         page-break-before: avoid;
118 }
119
120 table, figure {
121         page-break-inside: avoid;
122 }
123
124 td, th {
125         vertical-align: top;
126 }
127
128 ul.toc {
129         list-style: none;
130         margin: 0;
131         padding: 0;
132 }
133
134 /* create page numbers using target-counter in the TOC */
135 ul.toc a::after {
136   content: target-counter(attr(href), page);
137   float: right;
138 }
139
140 ul.toc li {
141         line-height: 2;
142 }
143
144 ul.toc li a {
145         text-decoration: none;
146 }
147
148 ol {
149         list-style-position: inside;
150 }
151
152 a {
153         color: #000;
154 }
155
156 /* add page number to cross references */
157 a.xref:after {
158   content: " (page " target-counter(attr(href, url), page) ")";
159 }