emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] export to odt with LaTeX math formulae and tables


From: edgar
Subject: Re: [O] export to odt with LaTeX math formulae and tables
Date: Fri, 18 May 2018 09:48:59 +0000
User-agent: Roundcube Webmail/1.2.4

On 2018-05-18 08:35, Joseph Vidal-Rosset wrote:
Hello Edgar, Nicolas, Eric, and everybody of the emacs-orgmode list,

I give news of my export tentatives from my .org file to odt , in a word:
it fails.
I suspect that the problem is my setup, but I am unable to be more precise
(if it was not the case, I could probably fix it).

Anyway, pandoc alone was useful and with

pandoc -f latex -t odt -o output.odt input.tex


or

pandoc my-document.tex -o my-document.docx


(I got help here:
https://askubuntu.com/questions/82634/how-to-convert-tex-into-odt
and here: https://jabranham.com/blog/2016/11/using-pandoc-export-to-word/ )

I have succeeded to get odt and docx files . But in these files:

   1. tables from tabular with multicolumn are not correctly exported,
   2. the bibliography is not exported
3. figures of natural deduction proofs produced with proof.sty cannot be read, because only the latex code is given (I suppose that I need png images, but because my org export to odt fails, the export of all natural
   deductions proof schema also fails.).

*Comment:* It is a terrible waste of time for a result that even if with a
lot of efforts the odt or docx export will finally succeed, the final
result will be far to be as nice as the pdf produced by the latex file.

Anyway, your help is still welcome.

Best wishes,

Jo.


Dear Jo,

First of all, I don't want you to have the wrong impression: I am not an Emacs nor Org guru. If I give you an advice, always, always take it with caution.

Secondly, I am glad that you are having progress! :D .

Thirdly, I think that I can help you with point (2). Did you try with pandoc like I said before?:

On 2018-05-16 20:19, address@hidden wrote:
Export to ~LaTeX~ file first with ~C-c C-e l l~

  pandoc --csl=council-of-science-editors.csl \
  --bibliography=/path/to/myreferences.bib \
  -f latex+smart inputfile.tex \
  -t docx+smart -o outputname.docx

You will need
1. a CSL file to set a style to your references (council-of-science-editors.csl in this example). You can get some from here: https://github.com/citation-style-language/styles
2. a bib style (I use Biber; I don't know if that matters, just try).

This has worked for me in the past to produce a DOCX with references.

What I actually recommend is to get that DOCX and copy the references to what Org mode exports as ODT (https://lists.gnu.org/archive/html/emacs-orgmode/2018-05/msg00346.html), then save the ODT as DOCX in LibreOffice. The ODT produced by Org is almost ready, and it carries the advantage of 1. tweaking an OTT (template) to your needs to set a specific format (see the link above; you can try the same with --reference-doc in pandoc, by the way). 2. being able to (partially use siunitx or other LaTeX commands with LaTeXMLMath; although pandoc is working on getting siunitx as well--make sure to get the latest version). If you see siunitx.sty.ltxml from Authorea's github.com (see link above), you'll see that it may be possible to tweak it to your needs for proof.sty. 3. produces tables (you may need to change the format; did I mention the OTT?)

One disadvantage of this method is that you may need to replace the key to the references to the format which you need (i.e. [authoryear] to [1]), but you can use the Replace All function from LibreOffice (if there are not many references). I would advise to keep a copy of the list after you do the first Replace All, because it's going to be lost the next time that you export.

I am sure that there is a good reason for which exporting with references has not been implemented in the ODT export function in Org. As I said, I am not a guru, and I am not going to complain to the developers if I can't code it myself, but you may want to post a feature request (may be I should too).

I have never used proof.sty, but I know that there is a way to ask Org to load a set of packages when exporting. May be that helps (look for the documentation of org-latex-default-packages-alist and org-latex-packages-alist; C-h v org-latex-default-packages-alist)

Bonne chance! :) .

-------------------------------------------------

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!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]