org: Working with OpenDocument style files
12.9.11.2 Working with OpenDocument style files
...............................................
This section explores the internals of the ODT exporter and the means by
which it produces styled documents. Read this section if you are
interested in exploring the automatic and custom OpenDocument styles
used by the exporter.
Factory styles
..............
The ODT exporter relies on two files for generating its output. These
files are bundled with the distribution under the directory pointed to
by the variable ‘org-odt-styles-dir’. The two files are:
• ‘OrgOdtStyles.xml’
This file contributes to the ‘styles.xml’ file of the final ‘ODT’
document. This file gets modified for the following purposes:
1. To control outline numbering based on user settings.
2. To add styles generated by ‘htmlfontify.el’ for fontification
of code blocks.
• ‘OrgOdtContentTemplate.xml’
This file contributes to the ‘content.xml’ file of the final ‘ODT’
document. The contents of the Org outline are inserted between the
‘<office:text>’...‘</office:text>’ elements of this file.
Apart from serving as a template file for the final ‘content.xml’,
the file serves the following purposes:
1. It contains automatic styles for formatting of tables which
are referenced by the exporter.
2. It contains ‘<text:sequence-decl>’...‘</text:sequence-decl>’
elements that control how various entities—tables, images,
equations, etc.—are numbered.
Overriding factory styles
.........................
The following two variables control the location from which the ODT
exporter picks up the custom styles and content template files. You can
customize these variables to override the factory styles used by the
exporter.
• ‘org-odt-styles-file’
Use this variable to specify the ‘styles.xml’ that will be used in
the final output. You can specify one of the following values:
1. A ‘styles.xml’ file
Use this file instead of the default ‘styles.xml’
2. A ‘.odt’ or ‘.ott’ file
Use the ‘styles.xml’ contained in the specified OpenDocument
Text or Template file
3. A ‘.odt’ or ‘.ott’ file and a subset of files contained within
them
Use the ‘styles.xml’ contained in the specified OpenDocument
Text or Template file. Additionally extract the specified
member files and embed those within the final ‘ODT’ document.
Use this option if the ‘styles.xml’ file references additional
files like header and footer images.
4. ‘nil’
Use the default ‘styles.xml’
• ‘org-odt-content-template-file’
Use this variable to specify the blank ‘content.xml’ that will be
used in the final output.