Table of Contents
- The Authoritative fork of Org mode's ODT exporter
- Miscellaneous
This is a fork of Org's ODT backend and adds many useful improvements to that backend. This fork is authoritative because it is maintained by the original author of that backend.
Add https://kjambunathan.github.io/elpa/
to package-archives
. Once that is done, you can install the exporter withM-x list-packages
.
(custom-set-variables
'(package-archives
(quote
(("gnu" . "https://elpa.gnu.org/packages/")
("ox-odt" . "https://kjambunathan.github.io/elpa/")))))
In the Emacs *Packages*
menu, the entry for the ODT backend looks like
ox-odt 9.2.1.205 available ox-odt OpenDocument Text Exporter for Org Mode
Ensure that you are using the enhanced ox-odt
and not the ox-odt
that comes with upstream emacs
or org-mode
-
Visit an
org
file:C-x C-f somefie.org
-
Export it to
odt
:C-c C-e o o
-
Switch to
*Messages*
buffer:C-x b *Messages*
. Inspect the path ofstyles
file.Here is a sample run on my setup.
ODT Zip Dir is /tmp/odt-fLRSbZ/ Formatting LaTeX using mathml Embedding /home/kjambunathan/src/org-mode-ox-odt/testing/examples/odt/publish/org-mode-unicorn.png as Images/0001.png... ----> ox-odt: Content template file is /home/kjambunathan/.emacs.d/elpa/ox-odt-9.5.3.437/etc/styles/OrgOdtContentTemplate.xml** Wrote /tmp/odt-fLRSbZ/content.xml ----> ox-odt: Styles file is /home/kjambunathan/.emacs.d/elpa/ox-odt-9.5.3.437/etc/styles/OrgOdtStyles.xml** Wrote /tmp/odt-fLRSbZ/styles.xml [2 times] Wrote /tmp/odt-fLRSbZ/meta.xml Wrote /tmp/odt-fLRSbZ/mimetype Wrote /tmp/odt-fLRSbZ/META-INF/manifest.xml Create OpenDocument file ‘3jacmbl0nfj0.odt’... Using schema ~/.emacs.d/elpa/ox-odt-9.5.3.437/etc/schema/od-schema.rnc Running zip -mX0 3jacmbl0nfj0.odt mimetype Running zip -rmTq 3jacmbl0nfj0.odt . Created /home/kjambunathan/src/org-mode-ox-odt/testing/examples/odt/publish/3jacmbl0nfj0.odt
The path of the
styles
files suggests thatox-odt
is coming from/home/kjambunathan/.emacs.d/elpa/ox-odt-9.5.3.437/
which is exactly what you want.
-
Add the following to the very end of your init file
(progn (require 'package) (setq load-path (cons (package-desc-dir (package--get-activatable-pkg 'ox-odt)) load-path)) (load-library "ox-odt"))
-
Re-start Emacs
(use-package ox-odt
:straight (org-mode-ox-odt
:host github
:repo "kjambunathan/org-mode-ox-odt"
:files ("lisp/ox-odt.el"
"lisp/odt.el"
"etc"
"docs"
"contrib/odt/LibreOffice")))
- Add the snippet you see below to
~/.doom.d/packages.el
,
(package! ox-odt
:recipe
(
:host github
:repo "kjambunathan/org-mode-ox-odt"
:files ("lisp/ox-odt.el"
"lisp/odt.el"
"etc"
"docs"
"contrib/odt/LibreOffice")))
- Do
~/.emacs.d/bin/doom sync
.
Doom-emacs uses straight.el, so it may be like this in the straight.el way.
Assuming that you have checked out the source under ~/src/
directory, add the following at THE VERY BOTTOM of your user-init-file
(setq load-path (cons "~/src/org-mode-ox-odt/lisp/" load-path))
(load-library "ox-odt")
-
Identify the most recent version of
ox-odt
from theorg-mode-ox-odt
ELPA. At the time of writing this note, it isox-odt-9.5.3.456.tar
. -
Download
ox-odt-9.5.3.456.tar
anduntar
it
~$ cd ~/Downloads/
~/Downloads$ wget https://raw.githubusercontent.com/kjambunathan/kjambunathan.github.io/master/elpa/ox-odt-9.5.3.456.tar
~/Downloads$ tar xvf ox-odt-9.5.3.456.tar
- Add the following at THE VERY BOTTOM of your
user-init-file
(progn
(setq load-path
(cons
;; Replace this path with where `ox-odt.el' can be found
"~/Downloads/ox-odt-9.5.3.456/"
load-path))
(load-library "ox-odt"))
- Restart Emacs
See Top (OpenDocument Text Exporter for Emacs’ Org Mode).
If you are an existing user of OpenDocument exporter, start with What is New (OpenDocument Text Exporter for Emacs’ Org Mode).
If you want a /near complete/, but a /crude/ list of features start with List of features that are exclusive to The Enhanced OpenDocument Exporter for Org mode.
If you want a blog-style, informal introduction to some of the features of this exporter, you may want to look at the following articles:
- Create a stylesheet for your OpenDocument files, and inline the XML definitions right in your Org file–Think HTML_HEAD, or HTML_HEAD_EXTRA but for ODT / DOCX files
- Create tables with paragraph-like content in Org mode, with the least amount of hassle
- Use Starmath—NOT LaTeX, NOT MathML—when exporting Org mode files to LibreOffice
- Mix Starmath and LaTeX / Mix English and Tamil in same Org file (or) How to conditionally export text using Macros and Drawers in Org mode
- Consult the manual Top (OpenDocument Text Exporter for Emacs’ Org Mode).
- Search
Issues
page. Whenever a new feature is added, I add a very user-friendly note to how that feature may be put to use. - If you have an issue or feature request, open an issue at
Issues
page - If you have a question, you can visit
Discussions
page
-
Will you merge this repo to upstream
Orgmode
orGNU Emacs
?Never
-
Will you put this repo on
MELPA
orGNU ELPA
?Never
-
Do you accept
Pull Requests
?I prefer bug reports and feature requests.
If you would like to customize the look of a document produced by this exporter, a good familiarity with LibreOffice
—this means working with styles
—is a must.
LibreOffice
comes with good set of User Guides. If you find that these guides are too detailed for your immediate needs, you may want to start with one of these:
- Students' Guide to OpenOffice Writer
- Writing a Thesis in OpenOffice.org
- Self-Publishing using LibreOffice Writer 6: How to use free software to write, design, and create ebooks and PDFs for print-on-demand books. For more recent versions, see Taming LibreOffice Resources for intermediate & advanced users.