我可以将 Tex 文件转换为等效的 Org 文件吗?如果是这样,怎么办?
我正在写一份白皮书,目前已经完成一半了。我刚刚意识到,在 org 模式下编写并导出到 Latex/pdf 比直接在 Latex 模式下编写要简单得多。有什么方法可以将现有的工作转换为组织模式文件吗?这将节省我必须手动完成的大量工作。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
看起来最新版本的 Pandoc 模式内置了对 Org 模式导出的支持。
It looks like the latest version of Pandoc mode has a built-in support for Org-mode export.
我也怀疑您是否会找到直接的工具。您需要使用一种工具或另一种工具进行一些搜索和替换。
可能有帮助的是使用 pandoc 将您的 LaTeX 转换为更接近
org-mode< /code> 语法,如“markdown”、“reStructuredText”或“MediaWiki”,然后执行您的
query-replace-regexp
魔法或编写一个小的sed
脚本。祝您旅途愉快!
更新:在 Google 中搜索"将 Latex 转换为wiki" 我发现 此页面 包含一个用于转换 LaTeX 源代码的 python 脚本代码到Qwiki标记,也许它会给你一些启发。
更新: 自 2018 年起,Pandoc 支持 org-mode 作为输入并直接输出格式,正如 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 yourquery-replace-regexp
magic or write a smallsed
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.
使用 pandoc 将 Latex 文件转换为 Markdown,然后使用一些查询替换和 emacs 宏手动将 Markdown 转换为 org-mode 会更容易吗?
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 启用 Latex 和 org-mode 之间的往返编辑,即,当您与使用乳胶的人合作时
https://github.com/uliw/l2org enables round-trip editing between latex and org-mode, i.e., when you collaborate with someone who uses latex
我怀疑是否有一个工具可以完成您的任务,但是使用 Emacs 应该能够节省许多击键操作。
对于许多 LaTeXism(例如带引号的字符),请尝试使用
query-replace
和query-replace-regexp
并查看效果如何。对于使用正则表达式无法轻松解决的问题,您可能会发现键盘宏很有用。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
andquery-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.