Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I convert a Tex file into an equivalent Org file? If so, how?

I'm in the process of writing a whitepaper, and am about half-way through. I've just realized that it would be far simpler to write this in org-mode and export to latex/pdf than writing it directly in latex-mode. Is there any way I can convert the existing work into an org mode file? It would save a lot of work I'd have to do manually.

like image 866
vedang Avatar asked Nov 17 '09 09:11

vedang


3 Answers

It looks like the latest version of Pandoc mode has a built-in support for Org-mode export.

enter image description here

like image 152
pkazmierczak Avatar answered Nov 13 '22 21:11

pkazmierczak


I doubt as well that you will find a direct tool. You'll need to do some search'n'replace with one tool or the other.

What might help is to use pandoc to convert your LaTeX to something closer to org-mode syntax like "markdown", "reStructuredText" or "MediaWiki" and then do your query-replace-regexp magic or write a small sed script.

Good luck on your journey!

UPDATE: Searching Google for "convert latex to wiki" I found this page with a python script to convert LaTeX source code to Qwiki markup, maybe it gives you some inspiration.

UPDATE: As of 2018, Pandoc supports org-mode as input and output format directly, as pointed out by pkazmierczak.

like image 32
danielpoe Avatar answered Nov 13 '22 21:11

danielpoe


Would it be a little easier to convert the latex file to markdown using pandoc and then manually convert markdown to org-mode with a few query-replaces and emacs macros ?

like image 2
Raja Selvaraj Avatar answered Nov 13 '22 20:11

Raja Selvaraj