From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Leduc Subject: Re: Sharing documents with bibtex bibliography from org to non-org users Date: Tue, 16 Aug 2016 21:30:14 -0400 Message-ID: References: <26f59a91-f9e1-3a95-13c9-300f97d40f16@gmail.com> Reply-To: ldcmrtn@gmail.com 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]:36682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZpgT-0005i4-DD for emacs-orgmode@gnu.org; Tue, 16 Aug 2016 21:30:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZpgR-0004JO-0u for emacs-orgmode@gnu.org; Tue, 16 Aug 2016 21:30:20 -0400 Received: from mail-qk0-x22b.google.com ([2607:f8b0:400d:c09::22b]:35410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZpgQ-0004JG-SV for emacs-orgmode@gnu.org; Tue, 16 Aug 2016 21:30:18 -0400 Received: by mail-qk0-x22b.google.com with SMTP id v123so88433643qkh.2 for ; Tue, 16 Aug 2016 18:30:18 -0700 (PDT) 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" To: Ken Mankoff Cc: emacs-orgmode@gnu.org Hi Ken, I tried the Pandoc solution first and the result appears quite satisfying to me. In the docx document, I can see citations, bibliography, figures and even equations. I will keep note of your first suggestion if I face issues with pandoc. Thanks, Martin On 08/16/2016 07:41 AM, Ken Mankoff wrote: > Hi Martin, > > The workflow I've been using for the past few months is this: > > 1) Export to ODT and then use LibreOffice to convert ODT to DOC with, > > (use-package ox-odt > :ensure nil > :config (progn > (setq org-odt-preferred-output-format "doc") > (setq org-odt-convert-processes > '(("LibreOffice" "/Applications/LibreOffice.app/Contents/MacOS/soffice --headless --convert-to %f%x %i"))))) > > Note that LibreOffice *cannot* be open/running while exporting, or the conversion fails. > > 2) Clean up the DOC file using the following LibreOffice macro (you can give its own toolbar button for easy access). This removes some LaTeX-specific formatting (examples: \( and \), \begin{equation}, \ref, etc.) and replaces some (examples: ^{-2} to -2). > > 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() = Array("\(", "\)", "\ref", "\mathrm", _ > "\begin{equation}", "\end{equation}", "\left", "\right", _ > "\singlespacing", "\doublespacing", "\,") > > mTeXStringsCNV() = Array("\sigma","σ", "\rho","ρ", "\sum", "∑", _ > "\phi","ɸ", "\partial","∂", "\Theta","Θ", "^{th}","th", "^{{th}}","th", _ > "^{-1}","-1", "^{-2}","-2", "^{2}","^2", "^{3}", "^3", "^{-3}", "^-3") > > > oDocument = ThisComponent > oReplace = oDocument.createReplaceDescriptor > For n = lbound(mTeXStringsNO()) To ubound(mTeXStringsNO()) > oReplace.SearchString = mTexStringsNO(n) > oReplace.ReplaceString = "" > oDocument.replaceAll(oReplace) > Next n > For n = lbound(mTeXStringsCNV()) To ubound(mTeXStringsCNV()) Step 2 > oReplace.SearchString = mTexStringsCNV(n) > oReplace.ReplaceString = mTexStringsCNV(n+1) > oDocument.replaceAll(oReplace) > Next n > End Sub > > > At this point, the DOC file is in decent shape, but equations are in raw LaTeX. The text does say things like see Figure {fig:foo} and Equation {eq:bar}. Figures are all numbered SEC.N, where SEC is the section number, and N restarts at 1 each section. References appear correctly as (Someone, 1942), or inline as Someone (1942), but there is no bibliography. It is easily readable, decently formatted, and much better than asking a co-author to read the raw LaTeX. > > 3) Export to PDF and compile the final product > > 4) Send both PDF and DOC to co-authors. Let them know they can read and mark up the DOC via Track Changes, but the PDF is the canonical version and should be used when looking at Equations, Figures, Bibliography, or anything else that appears suspect in the DOC file. > > 5) I manually integrate changes back into the Org file. > > Alternative workflows I've used in the past include Org -> LaTeX and then using Pandoc LaTeX -> DOCX. This version includes a bibliography, but overall I found the DOC more poorly formatted than the above workflow. If you prefer a cut-and-paste method, I'd consider Org -> HTML and then cut-and-paste that, rather than cut-and-paste PDF contents. > > I hope this helps, > > -k. > > > On 2016-08-16 at 03:36, Martin Leduc wrote: >> Hi orgers, >> >> People using org-mode or LaTeX to write scientific papers inevitably >> face problems when time comes to share a manuscript with co-authors for >> reviewing. Unless one decides to restrict the choice of his co-authors >> based exclusively on their knowledge of LaTeX, collaborators generally >> use Microsoft Word to write their documents. >> >> One way to share LaTeX documents with non-LaTeX users is to simply >> copy-paste the LaTeX file into a Word document. You can then share this >> file with other people along with a pdf-compiled version of the >> manuscript allowing them to see all references, bibliography, equations >> and figures. This is the most convenient approach for the first author, >> who can simply copy-paste back the text into a tex file after the rounds >> of review and then compile the LaTeX manuscript again following some >> minor debugging. >> >> However, the latter approach may not be suitable in situations where the >> document is intended to stay into a word format for whatever reason. It >> could be for instance because you want to be kind with some co-authors >> that wouldn't pay much interest into a scary document filled with >> complicated codes. >> >> So I would like to know what are the best known strategies to circumvent >> the latter issue. To simplify, I accept that I will need to rewrite the >> equations (and eq. numbers) in the Word document. What I really want, >> however, is all the citations and the list of references being managed >> automatically at the step of exporting from org to ODT or to Plain Text. >> >> The only solution I see now is to export the org document to a plain pdf >> (e.g. with no page numbers) and then to copy-paste the pdf into a Word >> document. This strategy is cumbersome because a lot of work is generally >> needed to format the word document (page wrapping, no line breaks >> between paragraphs, words hyphenation, etc). >> >> Is there any cleaner solutions to this issue ? Or more general ideas on >> how we could facilitate the sharing of documents containing a bibtex >> bibliography between org and non-org users ? >> >> Thanks >> >> Martin > > >