From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Julian M. Burgos" Subject: Re: Org + MS DOC Date: Thu, 04 Feb 2016 21:28:10 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRRRx-0003TD-9Q for emacs-orgmode@gnu.org; Thu, 04 Feb 2016 16:28:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRRRs-0007Ml-7N for emacs-orgmode@gnu.org; Thu, 04 Feb 2016 16:28:25 -0500 Received: from hafgarpur.hafro.is ([130.208.64.48]:33630) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRRRr-0007Ku-Ro for emacs-orgmode@gnu.org; Thu, 04 Feb 2016 16:28:20 -0500 In-reply-to: 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ken Mankoff Cc: org-mode The advantage of exporting via Pandoc is the possibility of including bibliographic citations. Do you know if it is possible to do this via ODT? Julian Ken Mankoff writes: > Hi, > > There is occasional discussion on the list (or SE or Reddit) about how = to best work with Word documents. In the past I've suggested Org -> Pando= c -> DOCX because that worked best for me when producing documents with e= quations, figures and tables. It didn't work great, but it worked best. > > I've recently found a new workflow that seems much better, and wanted t= o let others know about it. It removes the need for Pandoc and only uses = Org and LibreOffice. > > 1) Export to DOC (not DOCX) via ODT. Inline \(math\) in DOCX still look= s pretty bad, but is fine in DOC. > > (require 'ox-odt) > (setq org-odt-preferred-output-format "doc") > (setq org-odt-convert-processes '(("LibreOffice" "/Applications/LibreOf= fice.app/Contents/MacOS/soffice --headless --convert-to %f%x %i")))) > > 2) Run the following LibreOffice Macro to clean things up. I've assigne= d this to a toolbar button to make it easy to access. Add strings you wan= t to disappear to "mTeXStringsNO" and pairs of strings you want converted= to the "mTeXStringsCNV" arrays. > > 3) Email to Word Users. I always email the PDF copy to so they can see = the (psuedo)canonical version of the document. > > I hope this is helpful to some of you, > > -k. > > > > > Sub ReplaceTeXStrings > Dim mTeXStringsNO(99) As String > Dim mTeXStringsCNVfrom(99) As String > Dim mTexStringsCNVto(99) As String > Dim n As Long > Dim oDocument As Object > Dim oReplace As Object > > mTeXStringsNO() =3D Array("\(", "\)", "\ref", "\mathrm", _ > "\begin{equation}", "\end{equation}", "\left", "\right", _ > "\singlespacing", "\doublespacing") > =09 > mTeXStringsCNV() =3D Array("\sigma","=CF=83", "\rho","=CF=81", "\sum"= ,"=E2=88=91", _ > "\phi","=C9=B8", "\partial","=E2=88=82", "^{th}","th", "^{{th}}","th= ", _ > "^{-1}","-1", "^{-2}","-2") > =09 > oDocument =3D ThisComponent > oReplace =3D oDocument.createReplaceDescriptor > For n =3D lbound(mTeXStringsNO()) To ubound(mTeXStringsNO()) > oReplace.SearchString =3D mTexStringsNO(n) > oReplace.ReplaceString =3D "" > oDocument.replaceAll(oReplace) > Next n > For n =3D lbound(mTeXStringsCNV()) To ubound(mTeXStringsCNV()) Step 2 > oReplace.SearchString =3D mTexStringsCNV(n) > oReplace.ReplaceString =3D mTexStringsCNV(n+1) > oDocument.replaceAll(oReplace) > Next n > End Sub --=20 Julian Mariano Burgos, PhD Hafranns=C3=B3knastofnun/Marine Research Institute Sk=C3=BAlagata 4, 121 Reykjav=C3=ADk, Iceland S=C3=ADmi/Telephone : +354-5752037 Br=C3=A9fs=C3=ADmi/Telefax: +354-5752001 Netfang/Email: julian@hafro.is