Revision history for JSMathIntegration


Revision [23159]

Last edited on 2016-05-20 07:38:47 by PsuedoNym [Replaces old-style internal links with new pipe-split links.]
Additions:
~-[[ThirdPartyIntegration | Experimental 3rd party software integration in wikka]]
~-[[Docs:ThirdPartyInfo | 3rdparty software officially bundled with wikka]]
~-[[http://wiki.infopa.net/ | INFOPedia]] - a Wikka-powered wiki with JSMath support.
JSMath has a homepage [[http://www.math.union.edu/~dpvc/jsMath/welcome.html | here]]. A more thorough explanation of the way in which JSMath works is [[http://www.math.union.edu/~dpvc/jsMath/authors/welcome.html | here]].
Get the [[http://www.math.union.edu/~dpvc/jsMath/download/jsMath.html | package]], unzip it and upload the files in the following folder in your Wikka directory:
Deletions:
~-[[ThirdPartyIntegration Experimental 3rd party software integration in wikka]]
~-[[Docs:ThirdPartyInfo 3rdparty software officially bundled with wikka]]
~-[[http://wiki.infopa.net/ INFOPedia]] - a Wikka-powered wiki with JSMath support.
JSMath has a homepage [[http://www.math.union.edu/~dpvc/jsMath/welcome.html here]]. A more thorough explanation of the way in which JSMath works is [[http://www.math.union.edu/~dpvc/jsMath/authors/welcome.html here]].
Get the [[http://www.math.union.edu/~dpvc/jsMath/download/jsMath.html package]], unzip it and upload the files in the following folder in your Wikka directory:


Revision [19038]

Edited on 2008-01-28 00:13:52 by PsuedoNym [Modified links pointing to docs server]
Additions:
~-[[Docs:ThirdPartyInfo 3rdparty software officially bundled with wikka]]
Deletions:
~-[[ThirdPartyInfo 3rdparty software officially bundled with wikka]]


Revision [16090]

Edited on 2007-02-09 02:51:05 by PsuedoNym [Modified links pointing to docs server]
Additions:
==Latex Style Wiki Tags==
A short hack at formatters/wakka.php will lead to some much nicer Latex Style tags for entering & exiting math mode.
Edit formatters/wakka.php and add the following lines at the relevent line numbers (line numbers from original wakka.php. so work from the bottom up)
%%(php;41)
static $trigger_math_inline = 0;
static $trigger_math_block = 0;
%%(php;59)
if ($trigger_math_inline % 2) echo('</span>');
if ($trigger_math_block % 2) echo('</div>');
%%(php;136)
// Math Inline
else if ($thing == "$$")
{
return(++$trigger_math_inline % 2 ? "<span class=\"math\">" : "</span>");
}
else if ($thing == "\[" && $trigger_math_block == 0)
{
$trigger_math_block++;
return "<div class=\"math\">\n";
}
else if ($thing == "\]" && $trigger_math_block == 1)
{
$trigger_math_block = 0;
return "\n</div>\n";
}
%%(php, 414)
"\\$\\$|". # Math inline
"\\\\\\[|\\\\\\]|". # Math Block
then use $$ 1 +1 $$ for inline markup and \[ 1+1 \] for block markup.


Revision [13222]

Edited on 2006-02-19 04:00:27 by DarTar [adding link to demo website]
Additions:
>>**See also:**
**External links:**
~-[[http://wiki.infopa.net/ INFOPedia]] - a Wikka-powered wiki with JSMath support.
Deletions:
>>**See also**
====External Links====
~-[[http://stat.withif.com Statistics Wiki]] A wikka-powered website with JSMath support for mathematical formulas.


Revision [10776]

Edited on 2005-08-19 08:41:15 by DarTar [adding external link to Statistics Wiki]
Additions:
a_{21} & a_{22} & \ldots & a_{2n}\cr
\vdots & \vdots & \ddots & \vdots\cr
a_{m1} & a_{m2} & \ldots & a_{mn}}
====External Links====
~-[[http://stat.withif.com Statistics Wiki]] A wikka-powered website with JSMath support for mathematical formulas.
CategoryDevelopment3rdParty CategoryDevelopmentFormatters
Deletions:
a_{21} & a_{22} & \ldots & a_{2n}\cr
\vdots & \vdots & \ddots & \vdots\cr
a_{m1} & a_{m2} & \ldots & a_{mn}}
CategoryUserContributions


Revision [9947]

Edited on 2005-07-13 17:28:19 by JavaWoman [fixing category]
Additions:
CategoryUserContributions
Deletions:
CategoryDevelopmentArchitecture CategoryDevelopmentFormatters CategoryDevelopment3rdParty


Revision [9934]

Edited on 2005-07-10 14:11:34 by DarTar [adding sample output]
Additions:
echo '<script src="'.$this->config['jsmath_path'].'/jsMath.js" type="text/javascript"></script>';
echo '<script type="text/javascript">jsMath.Process()</script>';
Deletions:
echo '<script src="'.$this->config['jsmath_path'].'/jsMath.js"></script>';
echo '<script>jsMath.Process()</script>';


Revision [9933]

Edited on 2005-07-10 14:07:57 by DarTar [adding sample output]
Additions:
""<div class="math">
A = \pmatrix{a_{11} & a_{12} & \ldots & a_{1n}\cr
a_{21} & a_{22} & \ldots & a_{2n}\cr
\vdots & \vdots & \ddots & \vdots\cr
a_{m1} & a_{m2} & \ldots & a_{mn}}
\qquad\qquad
\pmatrix{y_1\cr\vdots\cr y_k}</div>""
""<span class="math">
2^{\raise1pt n}\hbox{ rather than }2^n \qquad
{\rm Fe_2^{+2} Cr_2^{\vphantom{+2}}O_4^{\vphantom{+2}}}
\hbox{ rather than }
{\rm Fe_2^{+2} Cr_2 O_4}
</span>""
{{image alt="JSMath sample output" title="JSMath example 3" url="images/jsmath3.jpg"}}
{{image alt="JSMath sample output" title="JSMath example 4" url="images/jsmath4.jpg"}}


Revision [9928]

Edited on 2005-07-10 10:36:15 by DarTar [adding sample output]
Additions:
if the JSMath engine works correctly the code above should be rendered as:
Deletions:
if the JSMath engine works correctly they should be rendered as:


Revision [9927]

Edited on 2005-07-10 10:35:39 by DarTar [adding see also box]
Additions:
""If <span class="math"> f(x) = x+2 </span> then <span class="math"> f(4) = 6 </span>. ""
""<div class="math"> \sum_{i=1}^{n} i = {n(n+1)\over 2} </div> ""
Deletions:
""If <SPAN CLASS="math"> f(x) = x+2 </SPAN> then <SPAN CLASS="math"> f(4) = 6 </SPAN>. ""
""<DIV CLASS="math"> \sum_{i=1}^{n} i = {n(n+1)\over 2} </DIV> ""


Revision [9923]

Edited on 2005-07-10 10:29:08 by DarTar [adding see also box]
Additions:
>>**See also**
~-[[ThirdPartyIntegration Experimental 3rd party software integration in wikka]]
~-[[ThirdPartyInfo 3rdparty software officially bundled with wikka]]
>>::c::
CategoryDevelopmentArchitecture CategoryDevelopmentFormatters CategoryDevelopment3rdParty
Deletions:
CategoryDevelopmentArchitecture


Revision [9922]

Edited on 2005-07-10 10:25:59 by DarTar [adding examples]
Additions:
{{image alt="JSMath sample output" title="JSMath example 1" url="images/jsmath1.jpg"}}
Deletions:
{{image alt="JSMath sample output" title="JSMath example 1" url="images/jmath1.jpg"}}


Revision [9921]

Edited on 2005-07-10 10:25:45 by DarTar [adding examples]
Additions:
if the JSMath engine works correctly they should be rendered as:
{{image alt="JSMath sample output" title="JSMath example 1" url="images/jmath1.jpg"}}
{{image alt="JSMath sample output" title="JSMath example 2" url="images/jsmath2.jpg"}}
(the above examples are pictures taken from a local installation; JSMath outputs math as formatted text)


Revision [9916]

Edited on 2005-07-10 10:13:58 by DarTar [adding hack to integrate JSMath]
Additions:
===== JSMath Integration =====
----
Here's a quick hack to integrate JSMath in Wikka
====The code====
''Version 0.1''
==1. Download and save the package ==
Get the [[http://www.math.union.edu/~dpvc/jsMath/download/jsMath.html package]], unzip it and upload the files in the following folder in your Wikka directory:
##3rdparty/plugins/jsmath/##
==2. Modify ##wikka.config.php##==
Add the JSMath options to the configuration file:
**original**
%%(php;20)
"geshi_path" => "3rdparty/plugins/geshi",
"geshi_languages_path" => "3rdparty/plugins/geshi/geshi",
%%
**modified**
%%(php;20)
"geshi_path" => "3rdparty/plugins/geshi",
"geshi_languages_path" => "3rdparty/plugins/geshi/geshi",
"enable_jsmath" => "1",
"jsmath_path" => "3rdparty/plugins/jsmath",
%%
==3. Modify ##actions/header.php##==
Insert the JSMath call in ##actions/header.php##:
**original**
%%(php;19)
<body <?php echo $message ? "onLoad=\"alert('".$message."');\" " : "" ?> >
<div class="header">
%%
**modified**
%%(php;19)
<body <?php echo $message ? "onLoad=\"alert('".$message."');\" " : "" ?> >
<?php
if (($this->GetMethod() == 'show') && ($this->GetConfigValue('enable_jsmath') == 1) && file_exists($this->config['jsmath_path'].'/jsMath.js')) {
echo '<script src="'.$this->config['jsmath_path'].'/jsMath.js"></script>';
}
?>
<div class="header">
%%
==4. Modify ##actions/footer.php##==
Insert the call to the JSMath formatter function at the end of ##actions/footer.php##:
%%(php)
<?php
if (($this->GetMethod() == 'show') && ($this->GetConfigValue('enable_jsmath') == 1) && file_exists($this->config['jsmath_path'].'/jsMath.js')) {
echo '<script>jsMath.Process()</script>';
}
?>
%%
==5. Test it ==
To add math in a Wikka page just use the ##math## class with embedded HTML:
For inline math, use: ##<span class="math">Here goes LaTeX code</span>##
For math blocks, use: ##<div class="math">Here goes LaTeX code</div>##
Try for example:
%%
""If <SPAN CLASS="math"> f(x) = x+2 </SPAN> then <SPAN CLASS="math"> f(4) = 6 </SPAN>. ""
""<DIV CLASS="math"> \sum_{i=1}^{n} i = {n(n+1)\over 2} </DIV> ""
%%
====To do====
~- create a dedicated formatter;
~- handle font-related error messages;
~- add support for ##""TeX""## fonts.
----
CategoryDevelopmentArchitecture


Revision [9915]

The oldest known version of this page was created on 2005-07-10 07:54:23 by ImagistTD [adding hack to integrate JSMath]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki