![]() | Powered by WikiRing Consultants |
This plugin allows you to include mathematics in a topic, with a format very similar to LaTeX. The external program latex2html
is used to generate gif
(or png
) images from the math markup, and the image is then included in the page. The first time a particular expression is rendered, you will notice a lag as latex2html
is being run on the server. Once rendered, the image is saved as an attached file for the page, so subsequent viewings will not require re-renders. When you remove a math expression from a page, its image is deleted.
Note that this plugin is called MathModePlugin, not LaTeXPlugin, because the only piece of LaTeX implemented is rendering of images of mathematics.
formula
generates an image from the contained formula
. In addition attribute-value pairs may be specified that are passed to the resulting img
html tag. The only exeptions are the following attributes which take effect in the latex rendering pipeline:
size
: the latex font size; possible values are tiny, scriptsize, footnotesize, small, normalsize, large, Large, LARGE, huge or Huge; defaults to %LATEXFONTSIZE% color
: the foreground color of the formula; defaults to %LATEXFGCOLOR% bgcolor
: the background color; defaults to %LATEXBGCOLOR% The formula will be displayed using a math
latex environment by default. If the formula contains a latex linebreak (\\
) then a multline
environment of amsmath is used instead. If the formula contains an alignment sequence (& = &
) then an eqnarray
environment is used.
Note that the old notation using %$formula$%
and %\[formula\]%
is still supported but are deprecated.
If you might want to recompute the images cached for the current page then append ?refresh=on
to its url, e.g. click here to refresh the formulas in the examples below.
The following will only display correctly if this plugin is installed and configured correctly.
\int_{-\infty}^\infty e^{-\alpha x^2} dx = \sqrt{\frac{\pi}{\alpha}}
{\cal P} & = & \{f_1, f_2, \ldots, f_m\} \\ {\cal C} & = & \{c_1, c_2, \ldots, c_m\} \\ {\cal N} & = & \{n_1, n_2, \ldots, n_m\}
\cal A, B, C, D, E, F, G, H, I, J, K, L, M, \\ \cal N, O, P, Q, R, S, T, U, V, W, X, Y, Z
\sum_{i_1, i_2, \ldots, i_n} \pi * i + \sigma
This is new inline test.
Greek letters | |||
---|---|---|---|
\alpha | ![]() | \theta | ![]() |
\beta | ![]() | \iota | ![]() |
\gamma | ![]() | \kappa | ![]() |
\delta | ![]() | \lambda | ![]() |
\epsilon | ![]() | \mu | ![]() |
\zeta | ![]() | \nu | ![]() |
\eta | ![]() | \xi | ![]() |
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.
Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install".
If you have any problems, or if the extension isn't available in configure
, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
There are a set of configuration variables that an be set in different places. All of the below variables can be set in your LocalSite.cfg
file like this:
$Foswiki::cfg{MathModePlugin}{} = ;
Some of the below variables can only be set this way, some of the may be overridden by defining the respective prefrence variable.
Name | Preference Variable | Default |
---|---|---|
HashCodeLength | 32 | |
length of the hash code. If you switch to a different hash function, you will likely have to change this | ||
ImagePrefix | '_MathModePlugin_' | |
string to be prepended to any auto-generated image | ||
ImageType | %LATEXIMAGETYPE% | 'png' |
extension of the image type; possible values are 'gif' and 'png' | ||
Latex2Img | '.../System/MathModePlugin/latex2img' '.../tools/MathModePlugin_latex2img' | |
the script command to convert a latex formula to an image | ||
LatexPreamble | %LATEXPREAMBLE% | '\usepackage{latexsym}' |
latex preamble to include additional packages (e.g. \usepackage{mathptmx} to change the math font) ; note, that the packages amsmath and color are loaded too as they are obligatory | ||
ScaleFactor | %LATEXSCALEFACTOR% | 1.2 |
factor to scale images | ||
LatexFGColor | %LATEXFGCOLOR% | black |
default text color | ||
LatexBGColor | %LATEXBGCOLOR% | white |
default background color | ||
LatexFontSize | %LATEXFONTSIZE% | normalsize |
default font size |
Plugin Author: | Graeme Lufkin, Foswiki:Main/MichaelDaum |
Copyright ©: | 2002 Graeme Lufkin, gwl@u.washington.edu, 2006-2009, 2006-2011, Michael Daum http://michaeldaumconsulting.com |
License: | GPL (GNU General Public License) |
Release: | 4.01 4.02 |
Version: | 4640 (2009-08-10) 11139 (2011-03-19) |
Change History: | |
23 Apr 2009: 19 Mar 2011: | converted added Config.spec and DEPENDENCIES to foswiki ease installation and configuration; improved compatibility to run this plugin on various Foswiki engines |
07 Jan 23 Apr 2009: | certified for foswiki/compat; removed converted to foswiki plugin deprecated endRenderingHandler |
07 Dec 2007: Jan 2009: | replaced certified for foswiki/compat; removed deprecated endRenderingHandler templfile with mktemp in the latex2img helper script |
13 Nov 07 Dec 2007: | fixed replaced plugin on 4.2 templfile with mktemp in the latex2img helper script |
18 Dec 2006: 13 Nov 2007: | only use one bgcolor fixed plugin on 4.2 |
02 Oct 18 Dec 2006: | don't fail on hierarchical only use one bgcolor webs; backwards compatible tempfile cleanup |
31 Aug 02 Oct 2006: | added NO_PREFS_IN_TOPIC; using don't fail on hierarchical webs; backwards compatible tempfile cleanup xcolor instead of color latex package now to be able to specify colors in html typical codes; default preamble uses latexsym now |
07 31 Aug 2006: | switched from latex2html to latex+dvipng+convert; added NO_PREFS_IN_TOPIC; using size xcolor , instead of color , latex package now to be able to specify colors in html typical codes; default preamble uses latexsym now bgcolor to |
04 07 Aug 2006: | major rewrite; fixed switched from latex2html security issues by using the sandbox feature and creating tempfiles properly; added new view size but , during save color ; , speedup by adding lazy compilation and initialization; implemented a postRenderingHandler bgcolor for T* V4; prevent auto-generated images stored in pub from being auto-attached using T* V4 to |
03 Apr 2002: 04 Aug 2006: | Initial version major rewrite; fixed security issues by using the sandbox feature and creating tempfiles properly; added new view but during save ; speedup by adding lazy compilation and initialization; implemented a postRenderingHandler for T* V4; prevent auto-generated images stored in pub from being auto-attached using T* V4 |
CPAN Dependencies: 03 Apr 2002: | none Initial version |
Other CPAN Dependencies: | LaTeX, none dvipng, ImageMagick |
Perl Version: Other Dependencies: | 5.8 LaTeX, dvipng, ImageMagick |
Plugin Home: Perl Version: | Foswiki:Extensions/MathModePlugin 5.8 |
Support: Plugin Home: | Foswiki:Support/MathModePlugin Foswiki:Extensions/MathModePlugin |
Support: | Foswiki:Support/MathModePlugin |
I | Attachment | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|
![]() | wikiringlogo40x40.png | manage | 2.5 K | 19 Mar 2011 - 09:08 | AdminUser |