开发者

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 man开发者_如何学Pythonually.


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

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


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.


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 ?


https://github.com/uliw/l2org enables round-trip editing between latex and org-mode, i.e., when you collaborate with someone who uses latex


I doubt that there is a tool for your task, but you should be able to save many keystrokes with Emacs.

For many LaTeXisms such as quoted characters, try using query-replace and query-replace-regexp and see how far that gets you. For things that aren't easily solved with regular expressions, you may find keyboard macros useful.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜