latex2twiki: kind of latex2wiki that converts (simple) LaTeX documents into TWiki source
I don't maintain it anymore as I don't need it. But patches are still welcomed ! Simply don't expect new features in the near futur !
- What is it ?
- Why?
- How does it work?
- What is it not doing?
- Ok, so what can it do?
- Come on, that's all??!
- Ok, so its result must be really ugly!
- Ok, you skip things I can live without... But what is really missing ?
- Where can I find and download it ?
- What about the futur ?
- Is there anything else similar ?
- Licence
What is it ?
A very simple python script that will try, as much as it can (=not much), to output from a .tex
something that will make TWiki happy. If you don't know what
a Wiki is, maybe you should check this page
as I'm not sure this software will help you...
Why ?
Because I needed it, one day... And Google did not answer me anything usefull. The only thing I found was a simple script that was not doing exactly what I was looking for (not handling LaTeX commands I needed, not the same wiki), so I hacked it (at least 20 locs!)... That's how latex2twiki was born.
How does it work ?
Simple! It takes your LaTeX from standard input and output the twiki code on standard output. You
can use the powerfull unix concept of pipes and/or all the wonderfull shell redirections:
cat mylatex.tex | ./latex2twiki.py > twiki.txt
What is it not doing ?
Currently, a lot ! It would be quicker to list what it does. For the moment, it does not:
- output error message when something is wrong. You have to check the result (for example by previewing it in twiki)
- handle complex LaTeX commands
Ok, so what can it do ?
Currently, it can:
- \\ : make a new line !
- \$ : print a '$'
- \_ : print a '_'
- `` , '' : nice quotes!
- \emph{}, \textit{}, \texttt{}, \textbf{} : change font
- itemize environement : it can handle these. It should not break if you have new lines in \item. It also handles nested environement!!
- verbatim environement : should be correctly handled (this one is easy)
- \section{}, \subsection{}, \subsubsection{} : section title, but no numbering.
Come on, that's all??!
No, in fact, it will also ignore a whole bunch of commands:
- it will skip everything until it finds a \begin{document}
- \footnotesize, \small, \begin{XX} and \end{XX} (where XX is not know), \tableofcontent, \null, \newpage, \thispagestyle, \maketitle, {, } : ignored (replace by nothing).
Ok, so its result must be really ugly !
In fact, it's not that bad. You can check for example this page as it's entirely generated with this tool.
Ok, you skip things I can live without... But what is really missing ?
What would really be usefull:
- \label{} and \ref{} : ignoring them makes gaps in the text, which is not a very good point.
Where can I find and download it ?
You can download the single script directly or you could check on the CVS if I had a public one... For CERN people, you can still use this link.
I know, I could open a GNA! or SourceForge project, but who cares ?
UPDATE: you can get it using bzr or your web browser. See this page
What about the futur (doc) ?
I don't really plan to make this a full blown compiler which supports thousands of command line arguments. Could be great, but for the moment, it's not in my TODO list. In fact, I don't even know if someone will ever use it... but who knows ? Maybe I will even receive patchs. I could also use this enhanced script...
Is there anything similar ?
In fact, yes, there is ! At least, there is the script on which I based mine (see below), but I'm aware of at least two other scripts:
- http://qwiki.caltech.edu/wiki/Converting_LaTex_To_Wiki
- http://www.wikiwaves.org/index.php/Converting_Latex_to_Wiki
Both pages have links to this page, that's how I found out. I don't know exactly how they changed my script... Maybe it can better fullfill your needs ?
Licence
As it was first a hack from this one(see also here), which is covered by GPL, I don't really have the choice, and by the way, I would have used this one if I had. Remeber what Richard says.
