]> Shamusworld >> Repos - ardour-manual/blob - source/css/pdf.css
PDF : allow breaking a table on multiple page, corrected a few wrong or duplicate...
[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 @font-face {
9     font-family: 'lora';
10     src: url('../css/Lora-Regular.ttf')  format('truetype');
11     font-weight: normal;
12     font-style: normal;
13 }
14
15 body {
16         font-family: 'lora';
17         font-size: 12px;
18 }
19
20 img {
21         max-width: 100%;
22 }
23
24 div.frontcover {
25         page-break-after: always;
26         margin: auto;
27         width: 80%;
28         font-size: 3em;
29         text-align: center;
30 }
31
32 .frontcover #generationdate {
33         font-size: .25em;
34         text-align: right;
35         bottom: 3cm;
36 }
37
38 /* styles for the right hand spread
39         Bottom left we display the title of the book, bottom right the page using a CSS
40   counter, top right the content of the current chapter
41 */
42 @page :right {
43    @bottom-left {
44        margin: 10pt 0 30pt 0;
45            content: "The Ardour Manual";
46        font-size: 7pt;
47        color: #333;
48    }
49    @bottom-right {
50        margin: 10pt 0 30pt 0;
51        content: counter(page);
52        font-size: 7pt;
53    }
54    @top-right {
55            content: string(doctitle);
56            margin: 30pt 0 10pt 0;
57            font-size: 7pt;
58            color: #333;
59    }
60 }
61
62 /* styles for the left hand spread
63         Bottom right book title, bottom left current page
64 */
65 @page :left {
66    @bottom-right {
67        margin: 10pt 0 30pt 0;
68            content: "The Ardour Manual";
69        font-size: 7pt;
70        color: #333;
71    }
72    @bottom-left {
73        margin: 10pt 0 30pt 0;
74        content: counter(page);
75        font-size: 7pt;
76    }
77 }
78
79 /* first page */
80 @page :first {
81   @bottom-right {
82     content: normal;
83     margin: 0;
84   }
85
86   @bottom-left {
87     content: normal;
88     margin: 0;
89   }
90 }
91
92 body {
93         counter-reset: partnum chapternum subchapternum subsubchapternum figurenum; /* resets all counters */
94         font-size: 10pt;
95         line-height: 1.25em;
96
97 }
98
99 h1, h2 {
100   string-set: doctitle content(); /* get the title of the current chapter */
101   page-break-before: always;
102 }
103
104 #toc::before { /* the ToC should not count...*/
105   content: none;
106   counter-reset: partnum;
107 }
108
109 h1::before { /* parts */
110         counter-increment: partnum;
111         content: "Part " counter(partnum) " - ";
112 }
113
114 h2::before {    /* chapter */
115         counter-increment: chapternum;
116         content: "Chapter " counter(chapternum) " - ";
117 }
118
119 h3::before {    /* subchapter */
120   counter-increment: subchapternum;
121   content: counter(chapternum) "." counter(subchapternum) " - " ;
122 }
123
124 h4::before {    /* subsubchapter */
125   counter-increment: subsubchapternum;
126   content: counter(chapternum) "." counter(subchapternum) "." counter(subsubchapternum) " - " ;
127 }
128
129 figcaption::before {
130         counter-increment: figurenum;
131         content: "Fig. " counter(chapternum) "." counter(figurenum) " - ";
132 }
133
134 h1 { font-size: 3em; }
135 h2 { font-size: 2.25em; counter-reset: subchapternum subsubchapternum figurenum; }
136 h3 { font-size: 1.75em; counter-reset: subsubchapternum; }
137 h4 { font-size: 1.4em; }
138 h5 { font-size: 1.2em; }
139 h6 { font-size: 1.1em; }
140
141 h1,h2,h3,h4,h5 {
142         font-weight: bold;
143         page-break-after: avoid;
144         page-break-inside: avoid;
145         line-height: 1.25em;
146         color: darkred;
147 }
148
149 h1+p, h2+p, h3+p {
150         page-break-before: avoid;
151 }
152
153 table {
154         clear: both;
155 }
156
157 figure {
158         page-break-inside: avoid;
159 }
160
161 td, th {
162         vertical-align: top;
163 }
164
165 ul.toc {
166         white-space: nowrap;
167         list-style: none;
168         margin: 0;
169         padding: 0;
170 }
171
172 /* create page numbers using target-counter in the TOC */
173 ul.toc a::after {
174   content: target-counter(attr(href), page);
175   float: right;
176 }
177
178 ul.toc li {
179         line-height: 2;
180 }
181
182 ul.toc li a {
183         text-decoration: none;
184 }
185
186 ol {
187         list-style-position: inside;
188 }
189
190 a {
191         color: #000;
192 }
193
194 /* add page number to cross references */
195 a[href^="#"]::after {
196   content: " (p. " target-counter(attr(href, url), page) ")";
197 }
198 a[href^="http"]::after {
199         content: " (" attr(href) ")";
200 }