Search code examples
emacslatexorg-mode

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.


Solution

  • 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.