Next: , Previous: Extending ODT export, Up: OpenDocument Text export

12.9.4 Applying custom styles

The ODT exporter ships with a set of OpenDocument styles (see Working with OpenDocument style files) that ensure a well-formatted output. These factory styles, however, may not cater to your specific tastes. To customize the output, you can either modify the above styles files directly, or generate the required styles using an application like LibreOffice. The latter method is suitable for expert and non-expert users alike, and is described here.

12.9.4.1 Applying custom styles: the easy way
  1. Create a sample example.org file with the below settings and export it to ODT format.
              #+OPTIONS: H:10 num:t
    
  2. Open the above example.odt using LibreOffice. Use the Stylist to locate the target styles—these typically have the ‘Org’ prefix—and modify those to your taste. Save the modified file either as an OpenDocument Text (.odt) or OpenDocument Template (.ott) file.
  3. Customize the variable org-odt-styles-file and point it to the newly created file. For additional configuration options see Overriding factory styles.

    If you would like to choose a style on a per-file basis, you can use the #+ODT_STYLES_FILE option. A typical setting will look like

              #+ODT_STYLES_FILE: "/path/to/example.ott"
    

    or

              #+ODT_STYLES_FILE: ("/path/to/file.ott" ("styles.xml" "image/hdr.png"))
    
12.9.4.2 Using third-party styles and templates

You can use third-party styles and templates for customizing your output. This will produce the desired output only if the template provides all style names that the ‘ODT’ exporter relies on. Unless this condition is met, the output is going to be less than satisfactory. So it is highly recommended that you only work with templates that are directly derived from the factory settings.