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