Project | WXT | Basics | Download | Documentation | Samples

PI: formula

The purpose of a formula is to fetch a formula in Image-, LaTeX- or MathML-form. The former two is presented as img-elements, while the latter is presented as MathML according to HTML5. LaTeX-formulas are translated to img on the fly with either WXT's internal functions based on JLaTeXMath [13] or with Google Charts Formulas [14] .

<?_wxt formula id=""?>

The parameters are:

id (mandatory) The formula we want to fetch. The formula is supposed to be defined in a formula file, Formulas , or an odtformula file , ODTFormulas . Alternatively this value will identify the formula introduced in sourse or location, se below.
type (optional) This is mandatory if source or location is set. Possible values are image, latex, google or mathml.
location (optional) The location may point to a file of one out of the 4 types: An image file (png,gif,jpg), a file containing a LaTeX-expression, a file containing LaTex for google or a file containing a MathMl-formula.
source (optional) The source may contain LaTeX description of a formula according to the version used by Google Charts Features [15] (type: google) or LaTex as handled by JLaTeXMath [13] (type: latex). It is sometimes possible, but not adviced to include mathml-source
subtext (optional) Any string describing the formula. Defaults to id.
color (optional) Must be specified as 6 hexdigits (#FF0000)
backcolor (optional) Must be specified as 6 hexdigits (#FF0000)
size (optional) Applies to TeX-formulas. You may spesify a size for LaTex or google-Latex: tiny, small,large or huge.
style (optional) Any CSS that will apply to the generated image-element.

Styleclass(es) describing this PI is: wxtformula, and for MathML-formulas wxtmathml See distributed std styles.

If both source and location is set, source is used.

More about formulas in Formulas .

Examples:

<div>
<?_wxt formula id="_formula1"?>
</div>
<div>
<?_wxt formula id="f2" type="latex" size="large" 
     source="B(t)=\sum_{i=0}^{n}B_{i}^{n}t^{i}(1-t)^{n-i}P_{_{i}}"?>
</div>
<div>
<?_wxt formula id="f3" size="small" color="#FFFF00"?>
</div>