Extension:Wiki2LaTeX

What can this extension do?
This extension converts Mediawikisyntax into LaTeX-code, and makes the result available as: The extension is written in php and uses its own parser, which is based on the original one of Mediawiki.
 * A textarea, where the code can be copied from
 * A .tex-file
 * A .pdf-file

Since the parser supports Parser Extension Tags, this extension enables Mediawiki to be used as a tool to create nicely printable documents. The parser also uses Mediawikis Hook-system, so you can hook in a function, which changes the current parser-result.

Supported Syntax features

 * ParserFunctions are supported (tested for 'if' and 'switch' only!)
 * ParserExtension-tags are supported.
 * Lists, even nested ones
 * italic and bold font-styles are supported
 * Internal and external links
 * Special characters are masked to LaTeX-commands
 * Some HTML-entities are parsed into their LaTeX-equivalents
 * The nowiki-tag is supported
 * Mediawikis Template-system can be used (with named and unnamed template parameters).
 * Tables

Please note, that even though it is supported, it can't be guaranteed, that everything works flawlessly. Not every possible case has been tested, so please report errors, in case something went wrong.

Limitations
There are some limitations:
 * The extension sometimes assumes german localization. This will be fixed in later versions.
 * Definition lists are parsed into HTML
 * pdf-export requires much cpu-power. So it can't be recommended, to empower users to personally export an article to pdf.
 * All parts are tested on Ubuntu 8.04 only.

Please be aware, that this extension is still in its beta-phase. There might be security issues, performance issues and any thinkable issue could come up. So this extension is not (yet) intended to be used on a public wiki, though it works as expected for quite a time now on my personal server to create documents for university and letters.

Planned features

 * Fix some issues regarding templates
 * Support interwiki links
 * Support definition lists
 * Support custom Magicword-variables
 * Find a way to parse articles, which are hosted by another wiki (far away!)
 * Add the ability to edit the latex-code before compiling it
 * Add the possibility to generate links from internal links
 * Support custom image LaTeX code
 * Support some HTML-Tags (like center, b, i, strong, em, tt...)
 * Support special classes on div and span tags

Documentation
Soon more a detailed documentationpage will be available.

Usage
After installation, there is a link next to the edit tab, which is labeled as "LaTeX". Click on it, choose some options and export the article.

Installation
Please have look at the wiki on the project site, where you can find some documentation.


 * 1) unpack all files of the archive into the folder '/extensions/w2l'.
 * 2) Check, if the subfolders 'tmp' and 'archive' exist and are writable by the server. If not, please create them and/or make them writable by your webserver.
 * 3) Have a look at the file w2lDefaultConfig.php</tt>, as some settings might need changes. Place your changes into the file w2lConfig.sample.php</tt>
 * 4) Rename w2lConfig.sample.php to w2lConfig.php
 * 5) Create the custom namespace LaTeX (optional, but required in order to use LaTeX-Templates and more personalized PDF-Creation).
 * 6) Make the changes to LocalSettings.php as described below.
 * 7) In order to use the pdf-export-feature, check out the LaTeX-Template-Documentation over at the project page. Additionally, the folder extensions/w2l/tmp/</tt> has to be writable by the server.

Changes to LocalSettings.php
Just add the following line at the end of LocalSettings.php (but before the end PHP-tag ?></tt> if it exists):

require_once($IP."/extensions/w2l/wiki2latex.php");

Update existing installations

 * 1) Read Release Notes as config changes might be required.
 * 2) Backup all files
 * 3) Remove all files except w2lConfig.php
 * 4) Unpack all new files into that folder

Development
Development takes place on a subpage.