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