# [tex4ht] latex -> mediawiki

Sat Jul 23 11:08:15 CEST 2011

On 07/23/2011 06:23 AM, Victor Ivrii wrote:
> It would be interesting and useful to have latex->mediawiki converter
>
> MathJax (which work almost perfectly with mediawiki) should take care
> of math but converter is supposed to convert (say)
>
> \section{My section} to =My section=
> \subsection{My subsection} to ==My subsection==
> \subsubsection{My subsubsection} to ===My subsubsection===
> \paragraph{My paragraph} to ===={My paragraph}====
> \subparagraph{My subparagraph} to ====={My subparagraph}=====
>
> also it should take care of theorem-like envirements and placing (but
> definitely not producing) graphics
>
> Also \texbf{...} should become '''...''' and \textit{...} and
> \emph{...} and \textsl{...} should become ''...'' (all quotes are
> single)

It is not overly difficult to write a package. Anybody who knows the
basics of configuring TeX4ht can easily write a custom configuration
file (say, mediawiki.cfg) that can go with a htlatex run to generate
output for mediwiki.

However, I don't make any promise to write one as I am struggling to
finish html5 and mathml3 packages for TeX4ht for months now. Couldn't
complete yet owing to the pressures at the day job.

> With math also some fix is needed: between two single ' should space
> be inserted (otherwise mediawiki decides that it is its own formatting
> command).

Those things are relatively easier to implement.

> I am not sure that this belongs to tex4ht (may be to some spin-off
> project). As another discussion has shown there is a certain interest
> in different formats (html, off, epub) and there are different ways of
> dealing with math (should be math converted to images, or left as it
> is, so either MathJax takes care or, for example, internal to
> mediawiki image generation should take care).
>
> This is not a feature request but just an invitation to discussion.

TeX4ht is an ingenious piece of software ever written in TeX macro
language. It is infinitely complex since it is infinitely configurable
and flexible except for its incompatibility with unicode input. TeX4ht
can generate any kind of html, XML, MathML, custom formats like
mediawiki, mathjax, jsmath, etc. Hence, all the above formats can fit
well into the scheme of TeX4ht.

Best
--