将LaTeX转换为MediaWiki语法 [英] Convert LaTeX to MediaWiki syntax

查看:123
本文介绍了将LaTeX转换为MediaWiki语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将LaTeX转换为MediaWiki语法.公式应该保持不变,但是我需要将例如\chapter{something}转换为= something =.

I need to convert LaTeX into MediaWiki syntax. The formulas should stay the same, but I need to transform, for example \chapter{something} into = something =.

尽管这可以通过使用sed来实现,但是在逐项环境下,事情会变得有些脏,所以我想知道是否可以产生更好的解决方案.

Although this can be obtained with a bit of sed, things get a little dirty with the itemize environment, so I was wondering if a better solution can be produced.

对这项任务有用的任何东西吗?

Anything that can be useful for this task?

推荐答案

Pandoc 应该能够做到:

$ pandoc -f latex -t mediawiki << END
> \documentclass{paper}
> \begin{document}
> \section{Heading}
> 
> Hello
> 
> \subsection{Sub-heading}
> 
> \textbf{World}!
> \end{document}
> END
== Heading ==

Hello

=== Sub-heading ===

'''World'''!

这篇关于将LaTeX转换为MediaWiki语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆