[pmwiki-users] jsMath - scalable mathematics

Vince Administration vadmin at math.uconn.edu
Tue Dec 26 18:03:42 CST 2006


Ben,
I would appreciate having it in the Cookbook.
Thanks for your effort.
        Vince

On Dec 26, 2006, at 5:29 PM, Ben Woodruff wrote:

> The following code should get jsMath to work in PMWiki.
>
> I'm not a PHP expert, nor do I know if what I have written is the best
> way of getting jsMath into the wiki, but it works, and it is rather
> short.  I believe some who have been using MimeTeX will find this
> addon rather nice.
>
> If there is interest, I will take some time to upload this as a
> cookbook recipe.  If there is not interest, then it can stay in the
> pmwiki-users database.
>
> If anyone has code improvement suggestions, please help me out.
>
> Ben Woodruff
>
> The main code is:
>
> //This line gives you LaTeX $$ $$ display equations in the center
>
> Markup('{$$', '<{$',
>  '/\\{\\$\$(.*?)\\$\$\\}/e',
>  "Keep('<DIV CLASS=math>'.'\${1}'.'</DIV>')");
>
>
> //This line gives you $ $ equations in line.  You can then use
> \displaystyle as normal to get pretty print equations inline.
>
> Markup('{$', 'directives',
>  '/\\{\\$(.*?)\\$\\}/e',
>  "Keep('<SPAN CLASS=math>'.'\${1}'.'</SPAN>')");
>
>
> $HTMLHeaderFmt['jsMathstuff'] =
>  '
> <SCRIPT> jsMath = {Controls: {cookie: {scale: 120}}} </SCRIPT>
> <SCRIPT SRC="http://path-to-jsMath/plugins/autoload.js"></SCRIPT>
>    <SCRIPT>
>      window.onload = function () {
>        jsMath.Autoload.Check();
>        jsMath.Process(document);
>      }
>    </SCRIPT>
> ';
> <jsMath.php>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users





More information about the pmwiki-users mailing list