Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert mediawiki to LaTeX syntax

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

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 ?

This is the reverse of this question (graciously copied). Pandoc was the answer to that question, but probably not yet for this.

like image 822
amit kumar Avatar asked Dec 29 '22 23:12

amit kumar


2 Answers

how about wiki2latex?

http://code.google.com/p/wiki2latex/

http://www.mediawiki.org/wiki/Extension:Wiki2LaTeX

Quoting from the mediawiki site:

This extension converts Mediawiki syntax into LaTeX-code, and makes the result available as:

* a text area, from which the code can be copied
* a .tex file
* a .pdf file

The extension is written in php and uses its own parser, which is based on the original one of Mediawiki.

Since the parser supports Parser Extension Tags, this extension enables Mediawiki to be used as a tool to create nicely printable documents. The parser also uses Mediawiki's Hook-system, so you can hook in functions, which change the default behavior of Wiki2LaTeX.

like image 145
xiechao Avatar answered Dec 31 '22 12:12

xiechao


I spend two years writing a tool for that. You can get it here it's under GPL.

http://de.wikibooks.org/wiki/Benutzer:Dirk_Huenniger/wb2pdf

Edit: The project has been accepted into Debian. A binary version for Windows is also available.

Edit: There also is a web interface http://mediawiki2latex.wmflabs.org/

like image 35
Dirk Avatar answered Dec 31 '22 12:12

Dirk