Extension:WikiTex
From MediaWiki.org
|
Release status: experimental |
|
|---|---|
| Implementation | Tag |
| Description | Enter math inside $..$ |
| Author(s) | Laszlo Csirmaz |
| Last Version | wikitex (14-01-2008) |
| MediaWiki | 1.7 |
| License | No license specified |
| Download | Extension:WikiTex/Installation |
|
check usage (experimental) |
|
Adding the <wikitex> ... </wikitex> tags for an easier entry of mathematical formulas.
Contents |
[edit] Problems with the standard <math> tag
- too much to type, error prone (<math>x</math> rather than $x$)
- slow to generate the result
- white background (rather than transparent)
- no proper vertical alignmentd
- smart syntax checker which knows better than I do.
is on a non-white background and aligned badly.While one can change formula background to transparent by hacking the helper function, it requires another round by the sloooow convert program.
[edit] What Extension:WikiTex offers
- math text is entered between $ symbols
- fast turnaround (using plain TeX -> dvipng)
- transparent background
- proper vertical alignment (almost)
- displayed formulas between $$ and $$
- user costumizable TeX definition files
[edit] Caveats
- no fancy things, all math is a picture
- unfriendly error messages (syntax error)
- easy littering: pictures of erased math text remain around
- possible formatting problems with new lines; certain extensions might not work properly (due to the recursive call of wiki formatting)
- tested on linux only
[edit] Parser extension tags
This extension adds two tags. The main additional tag is <wikitex> which indicates that from here math text is entered between $..$. Internally math text is wrapped inside <tex> tags, but this can also be used directly. The extension supports certain attributes, such as dpi=100 to make smaller images, or include="Math:Mycommands" to automatically include your TeX macros.
[edit] Documentation
Full documentation is in Extension:WikiTex/Documentation.
[edit] How to use it
Use <wikitex> and </wikitex> to enclose the part of the page (maybe the all page) on which you want to use the usual math editing:
<wikitex>
Let $Q$ be any finite set, and $\mathcal B=2^Q$ be the collection of the subsets of
$Q$. Let $f:\mathcal B\rightarrow \mathbb R$ be a function assigning real numbers to
the subsets of $Q$ and suppose $f$ satisfies the following conditions:
:(i) $f(A)\ge 0$ for all $A\subseteq Q$, $f(\emptyset)=0$,
:(ii) $f$ is monotone, i.e. if $A\subseteq B\subseteq Q$ then $f(A)\le f(B)$,
:(iii) $f$ is submodular, i.e. if $A$ and $B$ are different subsets of $Q$ then
$$f(A)+f(B)\ge f(A\cap B) + f(A\cup B).\eqno{(2)}$$
</wikitex>
Beware: formulas are typeset with plain TeX with some predefined commands (such as \mathcal or \mathbb above). LaTeX constructs do not work.
[edit] Formula numbers
Displayed formulas might have formula numbers. They should come inside the $$ signs, and it should be the argument of the TeX macro \eqno{...}:
$$f(A)+f(B)\ge f(A\cap B) + f(A\cup B). \eqno{(2)}$$
Be default, formula numbers appear on the right of the formula (but can be on the left when changing the appropriate style), and are not part of the formula.
$$a_2^3$$
[edit] Installation
- You need the standard <math> tag enabled and working
- You need an external worker program which transforms plain tex files into pictures and returns certain status information.
- If your wiki was configured with math, then probably TeX was installed. Otherwise you need to install TeX as well.
- Install dvipng, a fast dvi bitmap converter program.
- Copy the supplied shell program, or something similar, into /usr/local/bin/texconvert, or change the name and/or location in WikiTex.php.
- Install the supplied WikiTex.php program into the extensions directory of your wiki.
- Edit MediaWiki:Common.css which sets how displayed formulas are shown.
- Edit MediaWiki:TexInclude which contains some standard TeX macros.
- Enjoy
Details a and source are in Extension:WikiTex/Installation.
