views:

364

answers:

3

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

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 ?

A: 

I found this: plasTeX. With a bit of hacking probably I can produce a renderer for the mediawiki syntax

Stefano Borini
+2  A: 

pandoc can get your file converted between several different mark-up languages pretty easily, including mediawiki

Mica
+6  A: 

Pandoc should be able to do it:

$ 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'''!
jetxee
That's nice! thanks!
Stefano Borini
pandoc rules! go pandoc!
Norman Ramsey
unfortunately haskell does not work on snow leopard.
Stefano Borini
It's a pity you cannot build Pandoc on Snow Leopard. I don't know what the problem with GHC and Snow Leopard is, but it seems there are some workarounds. Quick googling gives me: http://www.haskell.org/pipermail/haskell-cafe/2009-September/066219.html http://passingcuriosity.com/2009/haskell-on-snow-leopard/
jetxee
a poor, but workable solution I've found to having the full set of command line tools available to my OS X workstation, without the use of fink or macports, is to run it in a virtual machine (virtual box for free, or fusion), then mount the host's (in this case OS X) file system to the linux VM, use the tools i need (pandoc).
Mica
Thanks, I made a little shell script to make it easier to use regularly "pandoc $1.tex -f latex -t mediawiki >> $1.wiki". Works well on SuSE
ccook