Skip to content

Instantly share code, notes, and snippets.

@kaushalmodi
Created July 28, 2017 21:12
Show Gist options
  • Save kaushalmodi/ee1b5ffce57973f9f51d84378bf61e30 to your computer and use it in GitHub Desktop.
Save kaushalmodi/ee1b5ffce57973f9f51d84378bf61e30 to your computer and use it in GitHub Desktop.

Template Org document for ODT export

Example

Blah Blah Blah Blah

Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah

Reference

When I started working on the ODT exporter, I relied on Students’ Guide to OpenOffice Writer to educate myself. To answer your specific questions, getting the Title Page and Abstract would be the tricky part. But it also illustrates what could be accomplished with the ODT exporter.

Specifically, with the Org snippet that follows, you would get

  1. Title page on a page by itself
  2. The Abstract in italics

provided you turn off all the fields that get inserted as part of C-c C-e #.

#+ATTR_ODT: :style "OrgPageImage" :anchor "page"
#+ATTR_ODT: :style "OrgTitle"
Title

#+ATTR_ODT: :style "OrgSubtitle"
Subtitle

#+PAGEBREAK:

#+ATTR_ODT: :style "Text"
  Abstract goes here.  Abstract goes here.  Abstract goes here.
  Abstract goes here.  Abstract goes here.  Abstract goes here.

* Blah Blah Blah Blah
Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah Blah blah
Blah blah Blah blah

For accomplishing rest of the styling, it is just a matter of working with LibreOffice’s stylist. The recommended workflow would be:

  1. You place your cursor on the text, that you feel is wrongly styled, let us say code block.
  2. Bring up the stylist, by pressing F11. The paragraph style you see would be OrgSrcBlock and OrgSrcBlockLastLine.
  3. Now customize the above styles to your heart’s content. (If you do this step right, the changes you made will be reflected in styles.xml that is zipped in to the odt file.)
  4. Store this file, say as, mystyle.odt.
  5. For styled export, you specify that file as part of
    #+ODT_STYLES_FILE: mystyle.odt
        

That is it.

The above example uses paragraph style for illustration, but the procedure is same for frame or page styles.

There is a test-new.org and test-new.odt under https://github.com/kjambunathan/org-mode-ox-odt/tree/master/testing/examples/odt which more or less demonstrates what is possible with my ODT exporter.

@kaushalmodi
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment