From mboxrd@z Thu Jan 1 00:00:00 1970 From: edgar@openmail.cc Subject: A way to export to ODT Date: Wed, 16 May 2018 01:31:20 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fIlIC-0007Px-7u for emacs-orgmode@gnu.org; Tue, 15 May 2018 21:31:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fIlI9-0002hV-2v for emacs-orgmode@gnu.org; Tue, 15 May 2018 21:31:48 -0400 Received: from onethreetwo.vfemail.net ([199.16.11.132]:34525 helo=vfemail.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fIlI8-0002gM-S6 for emacs-orgmode@gnu.org; Tue, 15 May 2018 21:31:45 -0400 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org I want to share this little recipe in the hope that it is useful to someone. It is a partial solution to exporting with MathML to ODT from Org. I am not a fan of ODT, but my boss need DOCX like dope. To get a working file 1. To get siunitx (partially) working, download [[https://github.com/Authorea/LaTeXML/blob/master/lib/LaTeXML/Package/siunitx.sty.ltxml][siunitx.sty.ltxml from Authorea's github.com]] (there is an issue on the upstream [[https://github.com/brucemiller/LaTeXML][LaTeXML]] for this already; the author may be more motivated is someone else asks for it and/or helps) and save it somewhere (remember this location, you'll need it later). Here, ~~/.emacs.d/plugins~ is used. Do ~C-c C-c~ or ~C-c C-v C-e~ (src_emacs-lisp{(org-babel-execute-maybe)}) on the following block to add ~\mathrm{ยท}~ to the symbols (this removes italics from units). Change the path to the file accordingly. #+BEGIN_SRC bash sed -i "s-\(DefMacro.*\)'\([[:alpha:]]*\)'-\1'\\\\mathrm{\2}'-g" ~/.emacs.d/plugins/siunitx.sty.ltxml #+END_SRC Add any required symbol to that same file (note that there is a ~\mm~ which should be ~\mmHg~; commit e134a5b @ Jul 24, 2017). Note that if you add something like ~DefMacro('\mm','some');~, strange things start to happen. 2. Install ~latexml~ (with ~latexmlmath~; https://dlmf.nist.gov/LaTeXML/get.html). Then, execute this command in Emacs (change ~latexmlmath~ to the actual path) #+BEGIN_SRC emacs-lisp (setq org-latex-to-mathml-convert-command "latexmlmath --presentationmathml=%o --preload=siunitx --path=~/.emacs.d/plugins/ --includestyles \"%i\"") #+END_SRC 3. Set the ~#+OPTIONS: LaTeX:t~ somewhere in the document 4. Export to odt with Org-mode (~C-c C-e o o~), and run this (you can do ~C-c C-c~ on it; make sure that LibreOffice is not running) #+BEGIN_SRC shell libreoffice --headless --convert-to doc ./.odt #+END_SRC You can use a template with the line (change file name accordingly). Modify the file at will. #+BEGIN_SRC org ,#+ODT_STYLES_FILE: "../Templates/odt-review-template.ott" #+END_SRC ------------------------------------------------- ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands! $24.95 ONETIME Lifetime accounts with Privacy Features! 15GB disk! No bandwidth quotas! Commercial and Bulk Mail Options!