User Rating 0.0
Total Usage 0 times
Supports sections, math, tables, lists, formatting, and references.
Read-only. Use Copy or Download to export.
Is this tool helpful?

Your feedback helps us improve.

About

LaTeX and MediaWiki wikitext are structurally incompatible markup systems. LaTeX uses nested brace-delimited commands (e.g., \frac{a}{b}) while wikitext relies on template syntax and HTML-like constructs. Manual conversion introduces transcription errors in math notation, broken table structures, and lost semantic hierarchy. This tool performs multi-pass transpilation: it strips document preambles, converts sectioning commands (\section==...==), transforms list environments into wikitext bullet/numbered syntax, parses tabular environments into wiki pipe-tables, and wraps remaining math in <math> tags for MediaWiki's Texvc renderer. The converter handles approximately 80 common LaTeX commands. It does not interpret custom macros defined via \newcommand or packages beyond the standard set. Documents exceeding ~50,000 characters may require sectional conversion.

latex wikitext mediawiki converter markup tex wikipedia

Formulas

The converter operates as a multi-pass string transpiler. No abstract syntax tree is built. Instead, the input passes through an ordered pipeline of regex-based transformations. Order matters: environments are resolved before inline commands to prevent partial matches inside already-converted blocks.

input stripPreamble convertEnvironments convertMath convertInlineCommands convertEscapes cleanup output

Each stage applies a set of regular expressions. Brace-matching uses a non-recursive greedy approach with a custom matchBraces utility that counts nesting depth (d) starting at 1 after encountering {, incrementing on each {, decrementing on each }, and returning the substring when d = 0. For tabular environments, column separators (&) are mapped to wiki pipe delimiters (||) and row separators (\\) to new table rows (|-).

Where input = raw LaTeX source string, output = MediaWiki-compatible wikitext. The stripPreamble function removes everything before \begin{document} and after \end{document} if present. The convertMath function wraps remaining TeX math in <math> tags, preserving the LaTeX math syntax that MediaWiki's Texvc engine understands natively.

Reference Data

LaTeX CommandWikitext OutputCategory
\section{Title}== Title ==Sectioning
\subsection{Title}=== Title ===Sectioning
\subsubsection{Title}==== Title ====Sectioning
\textbf{text}'''text'''Formatting
\textit{text} / \emph{text}''text''Formatting
\underline{text}<u>text</u>Formatting
\texttt{text}<code>text</code>Formatting
$...$ / \(...\)<math>...</math>Inline Math
$$...$$ / \[...\]<math display="block">...</math>Display Math
\begin{equation}<math display="block">...</math>Math Environment
\begin{align}<math display="block">\begin{align}...</math>Math Environment
\begin{itemize}* item (per line)Lists
\begin{enumerate}# item (per line)Lists
\begin{description}; term : definitionLists
\begin{tabular}{|c|c|}Wiki pipe table {| class="wikitable" |}Tables
\href{url}{text}[url text]Links
\url{url}[url]Links
\footnote{text}<ref>text</ref>References
\cite{key}<ref name="key" />References
\label{key}<span id="key"></span>References
\ref{key}[[#key]]References
\includegraphics{file}[[File:file|thumb]]Media
\begin{verbatim}<pre>...</pre>Code
\begin{quote}<blockquote>...</blockquote>Block
\begin{center}<div style="text-align:center">...</div>Block
\newpage / \clearpage(removed)Layout
\\<br />Layout
\&, \%, \#, \$&, %, #, $Escapes
\LaTeXLaTeXSpecial

Frequently Asked Questions

It does not expand custom macros. If your document defines \newcommand{\R}{\mathbb{R}}, the output will still contain \R. You must manually expand custom macros before conversion, or define them as MediaWiki templates. The converter only processes standard LaTeX commands from the base distribution and common packages (amsmath, graphicx, hyperref).
The converter handles one level of nesting for most environments. For example, an itemize inside an enumerate will produce #* prefixed lines in wikitext, which is correct MediaWiki syntax for nested lists. However, deeply nested tables or environments beyond 3 levels may require manual adjustment. The brace-matching algorithm tracks nesting depth up to 256 levels to avoid infinite loops.
Inline math ($...$ and \(...\)) is wrapped in <math>...</math> tags. Display math ($$...$$, \[...\], and equation/align environments) becomes <math display="block">...</math>. The LaTeX math content inside the tags is preserved verbatim because MediaWiki's Texvc/MathJax renderer parses TeX math natively. Commands like \frac, \sqrt, \sum remain as-is inside math tags.
Basic tabular environments with & column separators and \\ row separators are converted to wiki pipe tables. The \hline command is translated to the table border class. However, \multicolumn and \multirow are converted to their HTML equivalents (colspan and rowspan) within the wiki table syntax. Complex table formatting like \cline partial borders are stripped since wiki tables have limited border control.
No. BibTeX (.bib) files are external to the LaTeX source. The converter translates \cite{key} to <ref name="key" />, which is MediaWiki's reference syntax. You must separately create the reference definitions using <ref name="key">Citation text</ref> and add a <references /> tag at the bottom of your wiki page. The converter adds the references tag automatically if any \cite commands are detected.
The converter processes input synchronously in the browser. Documents up to approximately 500 KB (roughly 100 pages of LaTeX) convert in under 200 ms on modern hardware. Beyond 1 MB, you may experience noticeable delay. The textarea accepts up to 5 MB of text. For book-length documents, consider converting chapter by chapter.