1

When using org-mode, I would like to be able to save my org file (called here pad.org) in a ODT format. Here is what I have when trying save the file pad.org,

Auto-saving...done
org-babel-exp process python at position 2716...
Evaluate this python code block on your system? (y or n) n
Evaluation of this python code block is aborted.
LaTeX to MathML converter not available.
Formatting LaTeX using verbatim
Embedding c:/Users/Julien/Documents/ORG/img/IMG_3130.jpg as Images/0001.jpg...
Embedding c:/Users/Julien/Documents/ORG/img/ergoemacs-layout-fr.png as Images/0002.png...
Wrote c:/Users/Julien/AppData/Local/Temp/odt-ANDdwG/meta.xml
Using schema c:/Emacs/emacs-26.3-x86_64/share/emacs/26.3/etc/schema/od-schema-v1.2-os.rnc [2 times]
Saving file c:/Users/Julien/AppData/Local/Temp/odt-ANDdwG/styles.xml...
Wrote c:/Users/Julien/AppData/Local/Temp/odt-ANDdwG/styles.xml
Using vacuous schema
Wrote c:/Users/Julien/AppData/Local/Temp/odt-ANDdwG/mimetype
Using vacuous schema
Saving file c:/Users/Julien/AppData/Local/Temp/odt-ANDdwG/META-INF/manifest.xml...
Wrote c:/Users/Julien/AppData/Local/Temp/odt-ANDdwG/META-INF/manifest.xml
Saving file c:/Users/Julien/AppData/Local/Temp/odt-ANDdwG/content.xml...
Wrote c:/Users/Julien/AppData/Local/Temp/odt-ANDdwG/content.xml
Creating ODT file...
Running zip -mX0 pad.odt mimetype

When zip.exe is running, the GUI opens and I get the error message

Can't open -mX0 pad.odt

I'm a new user of emacs and org-mode on Windows 10. In the .emacs file I have the following lines :

;; Load ODT backend to allow for exporting to open document format.
(eval-after-load "org" '(require 'ox-odt nil t))

;;set env for odt
(setenv "PATH" (concat (getenv "PATH") ";" "C:\zip"))
    (setq exec-path (append exec-path '("C:\zip")))

In the folder C:\zip, I placed the zip executable (in fact Wiz.exe renamed zip.exe). With the command C-x C-e o o, I get the error message mentioned above.

I also tried with 7z.exe. But in that case, I have the error message :

Embedding c:/Users/Julien/Documents/ORG/img/ergoemacs-layout-fr.png as Images/0002.png...
Wrote c:/Users/Julien/AppData/Local/Temp/odt-gAEsLl/meta.xml
Using schema c:/Emacs/emacs-26.3-x86_64/share/emacs/26.3/etc/schema/od-schema-v1.2-os.rnc [2 times]
Saving file c:/Users/Julien/AppData/Local/Temp/odt-gAEsLl/styles.xml...
Wrote c:/Users/Julien/AppData/Local/Temp/odt-gAEsLl/styles.xml
Using vacuous schema
Wrote c:/Users/Julien/AppData/Local/Temp/odt-gAEsLl/mimetype
Using vacuous schema
Saving file c:/Users/Julien/AppData/Local/Temp/odt-gAEsLl/META-INF/manifest.xml...
Wrote c:/Users/Julien/AppData/Local/Temp/odt-gAEsLl/META-INF/manifest.xml
Saving file c:/Users/Julien/AppData/Local/Temp/odt-gAEsLl/content.xml...
Wrote c:/Users/Julien/AppData/Local/Temp/odt-gAEsLl/content.xml
Creating ODT file...
Running zip -mX0 pad.odt mimetype
OpenDocument export failed: Unable to create OpenDocument file.  Zip failed with error (
7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
jchopin
  • 13
  • 4
  • probably unreleated, but when setting your PATH, it looks like you are missing a `path-separator`, eg. `(concat (getenv...) path-separator ...)` – Rorschach Nov 03 '19 at 20:13
  • Thanks. I corrected the command adding ";" (is that correct?). Yet, the problem remains unsolved. I updated my question and added more information. – jchopin Nov 04 '19 at 22:07
  • I would use the variable `path-separator` instead of ";", but if you only use windows it doesn't matter – Rorschach Nov 04 '19 at 23:14

2 Answers2

1

Based on https://lists.gnu.org/archive/html/emacs-orgmode/2013-04/msg00538.html, you may also get the zip executable from

https://fossies.org/windows/misc/zip300xn.zip/

  • Thanks! I'm now able to export in odt format. I think that on the problem was that I was using the wrong zip and unzip executable. In a first step, I was using the GUI. For information, here is what I did: I uninstalled openoffice and installed instead libreoffice (don't know if it is crucial to do that). I downloaded the zip executables from https://fossies.org/windows/misc/zip300xn.zip/. Then, an unzip.exe was necessary. I got it there ftp://ftp.info-zip.org/pub/infozip/win32/unz600xn.exe. After running unzip.exe for install, I placed funzip.exe in the zip folder and rename it unzip.exe. – jchopin Nov 05 '19 at 13:18