Difference between revisions of "Converting Latex to Wiki"

From WikiWaves
Jump to navigationJump to search
 
Line 51: Line 51:
  
 
==References==
 
==References==
This script is based ''heavily'' on [http://qwiki.caltech.edu/index.php/Converting_LaTex_To_Wiki] which in  
+
This script is based ''heavily'' on [http://qwiki.caltech.edu/index.php/Converting_LaTex_To_Wiki Latex to Wiki on Qwiki] which in  
 
turn was based on [http://www.kataplop.net/pub/info/projets/latex2twiki latex2twiki.py].
 
turn was based on [http://www.kataplop.net/pub/info/projets/latex2twiki latex2twiki.py].

Revision as of 03:59, 2 June 2006

One of the goals of Qwiki is to facilitate the open exchange of scientific knowledge. We're hoping to make the activation energy as low as possible. To that end we're making available a script to help convert TeX tags into the correct form for wiki. At the moment the script doesn't handle the \newcommand environment or figures and certain types of tables. Python is required.

Caveat Emptor: This code IS NOT PERFECT. The script will do a lot of the leg work, but expect to make some minor modifications after the script has been run.

Usage

The script is executed using the following syntax:

>python latex2Qwiki.py < infile.tex >outfile.qwiki

That's really it.

Capabilities

The script will strip the preamble, \author tags etc. The \itemize environment is also recognized and parsed into a wiki list, however custom bullet types are not supported at the moment. The script makes the following replacements:

LaTeX replacement wikitext
\cite{} ([#References|references])
\emph{ txt } ''txt''
\texit{ txt } ''txt''
\texttt{ txt } =txt=
\textbf{ txt } '''txt'''
\textt{ txt } =txt=
\begin{ equation }(*?) or \[ <center><math>
\end{ equation }(*?) or \] </math></center>
\begin{ eqnarray }(*?) <center><math><\begin{matrix}>
\end{ eqnarray }(*?) <\end{matrix}></math></center>
$ <math>or </math>
\begin{verbatim} <br><code>
\end{verbatim} </code><br>
\[..]section appropriate wiki heading level

The Script

For security, python scripts cannot be served off of Qwiki. Please change the extension for '.txt' to '.py' after downloading.

latex2qwiki.txt

References

This script is based heavily on Latex to Wiki on Qwiki which in turn was based on latex2twiki.py.