source: xsl/styles/main-styles.xsl @ f4e7596

Revision f4e7596, 22.2 KB checked in by Aurélien Bompard <aurelien@…>, 3 years ago (diff)

Add individual styles to the definitions lists (#10)

  • Property mode set to 100644
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3
4    xhtml2odt - XHTML to ODT XML transformation.
5    Copyright (C) 2009 Aurelien Bompard
6    Inspired by the work on docbook2odt, by Roman Fordinal
7    http://open.comsultia.com/docbook2odf/
8
9    License: LGPL v2.1 or later <http://www.gnu.org/licenses/lgpl-2.1.html>
10
11    This library is free software; you can redistribute it and/or
12    modify it under the terms of the GNU Lesser General Public
13    License as published by the Free Software Foundation; either
14    version 2.1 of the License, or (at your option) any later version.
15
16    This library is distributed in the hope that it will be useful,
17    but WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19    Lesser General Public License for more details.
20
21    You should have received a copy of the GNU Lesser General Public
22    License along with this library; if not, write to the Free Software
23    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
24    MA  02110-1301  USA
25
26-->
27<xsl:stylesheet
28    xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
29    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
30    xmlns:dc="http://purl.org/dc/elements/1.1/"
31    xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
32    xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
33    xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
34    xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
35    xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
36    xmlns:xlink="http://www.w3.org/1999/xlink"
37    xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
38    xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
39    xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
40    xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
41    xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
42    xmlns:math="http://www.w3.org/1998/Math/MathML"
43    xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
44    xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
45    xmlns:dom="http://www.w3.org/2001/xml-events"
46    xmlns:xforms="http://www.w3.org/2002/xforms"
47    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
48    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
49    xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
50    version="1.0">
51
52<xsl:template name="mainstyles">
53
54    <xsl:if test="count(//office:styles/style:style[@style:name = 'Caption']) = 0">
55        <style:style style:name="Caption" style:display-name="Caption" style:class="extra"
56                     style:family="paragraph" style:parent-style-name="Standard">
57            <style:paragraph-properties fo:margin-top="0.2cm" fo:margin-bottom="0.2cm"
58                                        text:number-lines="false" text:line-number="0"/>
59            <style:text-properties fo:font-size="95%" fo:font-style="italic"/>
60        </style:style>
61    </xsl:if>
62
63    <xsl:if test="count(//office:styles/style:style[@style:name = 'Citation']) = 0">
64        <style:style style:name="Citation" style:display-name="Citation" style:family="text">
65            <style:text-properties fo:font-style="italic"/>
66        </style:style>
67    </xsl:if>
68
69    <xsl:if test="count(//office:styles/style:style[@style:name = 'Footnote']) = 0">
70        <style:style style:name="Footnote" style:display-name="Footnote"
71                     style:family="paragraph" style:class="extra"
72                     style:parent-style-name="Standard">
73            <style:paragraph-properties fo:margin-left="0.5cm" fo:margin-right="0cm"
74                   fo:text-indent="-0.5cm" style:auto-text-indent="false"
75                   text:number-lines="false" text:line-number="0"/>
76            <style:text-properties fo:font-size="10pt"/>
77        </style:style>
78    </xsl:if>
79
80    <xsl:if test="count(//office:styles/style:style[@style:name = 'Heading_20_1']) = 0">
81        <style:style style:name="Heading_20_1" style:display-name="Heading 1"
82                      style:family="paragraph" style:parent-style-name="Heading"
83                      style:next-style-name="Text_20_body" style:class="text"
84                      style:default-outline-level="1">
85            <style:text-properties fo:font-size="115%" fo:font-weight="bold"/>
86        </style:style>
87    </xsl:if>
88
89    <xsl:if test="count(//office:styles/style:style[@style:name = 'Heading_20_2']) = 0">
90        <style:style style:name="Heading_20_2" style:display-name="Heading 2"
91                      style:family="paragraph" style:parent-style-name="Heading"
92                      style:next-style-name="Text_20_body" style:class="text"
93                      style:default-outline-level="2">
94            <style:text-properties fo:font-size="110%" fo:font-weight="bold"
95                                   fo:font-style="italic"/>
96        </style:style>
97    </xsl:if>
98
99    <xsl:if test="count(//office:styles/style:style[@style:name = 'Heading_20_3']) = 0">
100        <style:style style:name="Heading_20_3" style:display-name="Heading 3"
101                      style:family="paragraph" style:parent-style-name="Heading"
102                      style:next-style-name="Text_20_body" style:class="text"
103                      style:default-outline-level="3">
104            <style:text-properties fo:font-size="105%" fo:font-weight="bold"/>
105        </style:style>
106    </xsl:if>
107
108    <xsl:if test="count(//office:styles/style:style[@style:name = 'Heading_20_4']) = 0">
109        <style:style style:name="Heading_20_4" style:display-name="Heading 4"
110                      style:family="paragraph" style:parent-style-name="Heading"
111                      style:next-style-name="Text_20_body" style:class="text"
112                      style:default-outline-level="4">
113            <style:text-properties fo:font-size="100%" fo:font-weight="bold"/>
114        </style:style>
115    </xsl:if>
116
117    <xsl:if test="count(//office:styles/style:style[@style:name = 'Heading_20_5']) = 0">
118        <style:style style:name="Heading_20_5" style:display-name="Heading 5"
119                      style:family="paragraph" style:parent-style-name="Heading"
120                      style:next-style-name="Text_20_body" style:class="text"
121                      style:default-outline-level="5">
122            <style:text-properties fo:font-size="100%" fo:font-style="italic"/>
123        </style:style>
124    </xsl:if>
125
126    <xsl:if test="count(//office:styles/style:style[@style:name = 'Heading_20_6']) = 0">
127        <style:style style:name="Heading_20_6" style:display-name="Heading 6"
128                      style:family="paragraph" style:parent-style-name="Heading"
129                      style:next-style-name="Text_20_body" style:class="text"
130                      style:default-outline-level="6">
131            <style:text-properties fo:font-size="90%" fo:font-weight="bold"
132                                   style:text-underline-style="solid"
133                                   style:text-underline-width="auto"
134                                   style:text-underline-color="font-color"/>
135        </style:style>
136    </xsl:if>
137
138    <xsl:if test="count(//office:styles/style:style[@style:name = 'Horizontal_20_Line']) = 0">
139        <style:style style:name="Horizontal_20_Line" style:display-name="Horizontal Line"
140                     style:family="paragraph" style:parent-style-name="Standard"
141                     style:next-style-name="Text_20_body" style:class="html">
142            <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.5cm"
143                         style:border-line-width-bottom="0.002cm 0.035cm 0.002cm"
144                         fo:padding="0cm" fo:border-left="none" fo:border-right="none"
145                         fo:border-top="none" fo:border-bottom="0.04cm double #808080"
146                         text:number-lines="false" text:line-number="0"
147                         style:join-border="false"/>
148            <style:text-properties fo:font-size="6pt"/>
149        </style:style>
150    </xsl:if>
151
152    <xsl:if test="count(//office:styles/style:style[@style:name = 'List_20_1']) = 0">
153        <text:list-style style:name="List_20_1" style:display-name="List 1">
154            <text:list-level-style-bullet text:level="1"
155                    text:style-name="Bullet_20_Symbols"
156                    text:bullet-char="•">
157                <style:list-level-properties
158                    text:space-before="0.5cm"
159                    text:min-label-width="0.5cm"/>
160            </text:list-level-style-bullet>
161            <text:list-level-style-bullet text:level="2"
162                    text:style-name="Bullet_20_Symbols"
163                    text:bullet-char="◦">
164                <style:list-level-properties
165                    text:space-before="1cm"
166                    text:min-label-width="0.5cm"/>
167            </text:list-level-style-bullet>
168            <text:list-level-style-bullet text:level="3"
169                    text:style-name="Bullet_20_Symbols"
170                    text:bullet-char="▪">
171                <style:list-level-properties
172                    text:space-before="1.5cm"
173                    text:min-label-width="0.5cm"/>
174            </text:list-level-style-bullet>
175            <text:list-level-style-bullet text:level="4"
176                    text:style-name="Bullet_20_Symbols"
177                    text:bullet-char="•">
178                <style:list-level-properties
179                    text:space-before="2cm"
180                    text:min-label-width="0.5cm"/>
181            </text:list-level-style-bullet>
182            <text:list-level-style-bullet text:level="5"
183                    text:style-name="Bullet_20_Symbols"
184                    text:bullet-char="◦">
185                <style:list-level-properties
186                    text:space-before="2.5cm"
187                    text:min-label-width="0.5cm"/>
188            </text:list-level-style-bullet>
189            <text:list-level-style-bullet text:level="6"
190                    text:style-name="Bullet_20_Symbols"
191                    text:bullet-char="▪">
192                <style:list-level-properties
193                    text:space-before="3cm"
194                    text:min-label-width="0.5cm"/>
195            </text:list-level-style-bullet>
196            <text:list-level-style-bullet text:level="7"
197                    text:style-name="Bullet_20_Symbols"
198                    text:bullet-char="•">
199                <style:list-level-properties
200                    text:space-before="3.5cm"
201                    text:min-label-width="0.5cm"/>
202            </text:list-level-style-bullet>
203            <text:list-level-style-bullet text:level="8"
204                    text:style-name="Bullet_20_Symbols"
205                    text:bullet-char="◦">
206                <style:list-level-properties
207                    text:space-before="4cm"
208                    text:min-label-width="0.5cm"/>
209            </text:list-level-style-bullet>
210            <text:list-level-style-bullet text:level="9"
211                    text:style-name="Bullet_20_Symbols"
212                    text:bullet-char="▪">
213                <style:list-level-properties
214                    text:space-before="4.5cm"
215                    text:min-label-width="0.5cm"/>
216            </text:list-level-style-bullet>
217            <text:list-level-style-bullet text:level="10"
218                    text:style-name="Bullet_20_Symbols"
219                    text:bullet-char="•">
220                <style:list-level-properties
221                    text:space-before="5cm"
222                    text:min-label-width="0.5cm"/>
223            </text:list-level-style-bullet>
224        </text:list-style>
225    </xsl:if>
226
227    <xsl:if test="count(//office:styles/style:style[@style:name = 'Numbering_20_1']) = 0">
228        <text:list-style style:name="Numbering_20_1" style:display-name="Numbering 1">
229            <text:list-level-style-number text:level="1"
230                    text:style-name="Numbering_20_Symbols"
231                    style:num-suffix="."
232                    style:num-format="1">
233                <style:list-level-properties
234                    text:space-before="0.5cm"
235                    text:min-label-width="0.5cm"/>
236            </text:list-level-style-number>
237            <text:list-level-style-number text:level="2"
238                    text:style-name="Numbering_20_Symbols"
239                    style:num-suffix="."
240                    style:num-format="1">
241                <style:list-level-properties
242                    text:space-before="1cm"
243                    text:min-label-width="0.5cm"/>
244            </text:list-level-style-number>
245            <text:list-level-style-number text:level="3"
246                    text:style-name="Numbering_20_Symbols"
247                    style:num-suffix="."
248                    style:num-format="1">
249                <style:list-level-properties
250                    text:space-before="1.5cm"
251                    text:min-label-width="0.5cm"/>
252            </text:list-level-style-number>
253            <text:list-level-style-number text:level="4"
254                    text:style-name="Numbering_20_Symbols"
255                    style:num-suffix="."
256                    style:num-format="1">
257                <style:list-level-properties
258                    text:space-before="2cm"
259                    text:min-label-width="0.5cm"/>
260            </text:list-level-style-number>
261            <text:list-level-style-number text:level="5"
262                    text:style-name="Numbering_20_Symbols"
263                    style:num-suffix="."
264                    style:num-format="1">
265                <style:list-level-properties
266                    text:space-before="2.5cm"
267                    text:min-label-width="0.5cm"/>
268            </text:list-level-style-number>
269            <text:list-level-style-number text:level="6"
270                    text:style-name="Numbering_20_Symbols"
271                    style:num-suffix="."
272                    style:num-format="1">
273                <style:list-level-properties
274                    text:space-before="3cm"
275                    text:min-label-width="0.5cm"/>
276            </text:list-level-style-number>
277            <text:list-level-style-number text:level="7"
278                    text:style-name="Numbering_20_Symbols"
279                    style:num-suffix="."
280                    style:num-format="1">
281                <style:list-level-properties
282                    text:space-before="3.5cm"
283                    text:min-label-width="0.5cm"/>
284            </text:list-level-style-number>
285            <text:list-level-style-number text:level="8"
286                    text:style-name="Numbering_20_Symbols"
287                    style:num-suffix="."
288                    style:num-format="1">
289                <style:list-level-properties
290                    text:space-before="4cm"
291                    text:min-label-width="0.5cm"/>
292            </text:list-level-style-number>
293            <text:list-level-style-number text:level="9"
294                    text:style-name="Numbering_20_Symbols"
295                    style:num-suffix="."
296                    style:num-format="1">
297                <style:list-level-properties
298                    text:space-before="4.5cm"
299                    text:min-label-width="0.5cm"/>
300            </text:list-level-style-number>
301            <text:list-level-style-number text:level="10"
302                    text:style-name="Numbering_20_Symbols"
303                    style:num-suffix="."
304                    style:num-format="1">
305                <style:list-level-properties
306                    text:space-before="5cm"
307                    text:min-label-width="0.5cm"/>
308            </text:list-level-style-number>
309        </text:list-style>
310    </xsl:if>
311
312    <xsl:if test="count(//office:styles/style:style[@style:name = 'Definition_20_Term']) = 0">
313        <style:style style:name="Definition_20_Term"
314                     style:display-name="Definition Term" style:family="paragraph"
315                     style:parent-style-name="Text_20_body" style:class="html">
316            <style:text-properties fo:font-weight="bold"/>
317            <style:paragraph-properties fo:margin-bottom="0cm"/>
318        </style:style>
319    </xsl:if>
320
321    <xsl:if test="count(//office:styles/style:style[@style:name = 'Definition_20_Description']) = 0">
322        <style:style style:name="Definition_20_Description"
323                     style:display-name="Definition Description" style:family="paragraph"
324                     style:parent-style-name="Text_20_body" style:class="html">
325            <style:paragraph-properties fo:margin-top="0cm" fo:margin-left="1cm"
326                                        fo:margin-bottom="0.2cm"/>
327        </style:style>
328    </xsl:if>
329
330    <xsl:if test="count(//office:styles/style:style[@style:name = 'Preformatted_20_Text']) = 0">
331        <style:style style:name="Preformatted_20_Text"
332                     style:display-name="Preformatted Text" style:family="paragraph"
333                     style:parent-style-name="Standard" style:class="html">
334            <style:paragraph-properties fo:margin-left="1cm" fo:margin-right="1cm"
335                                        fo:margin-top="0cm" fo:margin-bottom="0cm"/>
336            <style:text-properties style:font-name="DejaVu Sans Mono"
337                                   fo:font-size="9pt"/>
338        </style:style>
339    </xsl:if>
340
341    <xsl:if test="count(//office:styles/style:style[@style:name = 'Source_20_Code']) = 0">
342        <style:style style:name="Source_20_Code"
343                     style:display-name="Source Code" style:family="paragraph"
344                     style:parent-style-name="Preformatted_20_Text">
345            <style:paragraph-properties fo:padding="0.05cm" style:shadow="none"
346                                        fo:border="0.002cm solid #c0c0c0"/>
347        </style:style>
348    </xsl:if>
349
350    <xsl:if test="count(//office:styles/style:style[@style:name = 'Source_20_Code_20_Numbered']) = 0">
351        <style:style style:name="Source_20_Code_20_Numbered"
352                     style:display-name="Source Code Numbered" style:family="paragraph"
353                     style:list-style-name="Numbering_20_1"
354                     style:parent-style-name="Source_20_Code">
355            <style:paragraph-properties text:number-lines="true" text:line-number="1"/>
356        </style:style>
357    </xsl:if>
358
359    <xsl:if test="count(//office:styles/style:style[@style:name = 'Quotations']) = 0">
360        <style:style style:name="Quotations" style:family="paragraph"
361                     style:display-name="Quotations"
362                     style:parent-style-name="Standard" style:class="html">
363            <style:paragraph-properties fo:margin-left="1cm" fo:margin-right="1cm"
364                                        fo:margin-top="0cm" fo:margin-bottom="0.5cm"
365                                        fo:text-indent="0cm" style:auto-text-indent="false"
366                                        fo:padding="0.2cm"
367                                        fo:border-left="0.088cm solid #999999"/>
368        </style:style>
369    </xsl:if>
370
371    <xsl:if test="count(//office:styles/style:style[@style:name = 'Sender']) = 0">
372        <style:style style:name="Sender" style:display-name="Sender" style:class="extra"
373                     style:family="paragraph" style:parent-style-name="Standard">
374            <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.100cm"
375                                        text:number-lines="false" text:line-number="0"/>
376            <style:text-properties fo:font-style="italic"/>
377        </style:style>
378    </xsl:if>
379
380    <xsl:if test="count(//office:styles/style:style[@style:name = 'Table_20_Contents']) = 0">
381        <style:style style:name="Table_20_Contents" style:display-name="Table Contents"
382                     style:family="paragraph" style:parent-style-name="Standard"
383                     style:class="extra">
384            <style:paragraph-properties text:number-lines="false" text:line-number="0"/>
385        </style:style>
386    </xsl:if>
387
388    <xsl:if test="count(//office:styles/style:style[@style:name = 'Table_20_Heading']) = 0">
389        <style:style style:name="Table_20_Heading" style:display-name="Table Heading"
390                     style:family="paragraph" style:parent-style-name="Table_20_Contents"
391                     style:class="extra">
392            <style:paragraph-properties fo:text-align="center" style:justify-single-word="false"
393                                        text:number-lines="false" text:line-number="0"/>
394            <style:text-properties fo:font-weight="bold"/>
395        </style:style>
396    </xsl:if>
397
398    <xsl:if test="count(//office:styles/style:style[@style:name = 'Teletype']) = 0">
399        <style:style style:name="Teletype" style:display-name="Teletype"
400                     style:family="text">
401            <style:text-properties style:font-name="DejaVu Sans Mono"
402                                   fo:font-size="9pt"/>
403        </style:style>
404    </xsl:if>
405
406    <xsl:if test="count(//office:styles/style:style[@style:name = 'Marginalia']) = 0">
407        <style:style style:name="Marginalia" style:display-name="Marginalia"
408                     style:family="graphic">
409            <style:graphic-properties svg:width="8.5cm" style:rel-width="50%"
410                                      fo:min-height="0.5cm"
411                                      text:anchor-type="paragraph"
412                                      svg:x="0cm" svg:y="0cm"
413                                      fo:margin-left="0.2cm"
414                                      fo:margin-right="0cm"
415                                      fo:margin-top="0.1cm"
416                                      fo:margin-bottom="0.1cm"
417                                      style:wrap="parallel"
418                                      style:number-wrapped-paragraphs="no-limit"
419                                      style:wrap-contour="false"
420                                      style:vertical-pos="top"
421                                      style:vertical-rel="paragraph"
422                                      style:horizontal-pos="right"
423                                      style:horizontal-rel="paragraph"
424                                      fo:background-color="transparent"
425                                      style:background-transparency="100%"
426                                      fo:padding="0.15cm"
427                                      fo:border="0.002cm solid #000000"
428                                      style:shadow="none">
429            </style:graphic-properties>
430        </style:style>
431    </xsl:if>
432
433</xsl:template>
434
435</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.