[pmwiki-users] jsMath - scalable mathematics

Ben Woodruff bmwoodruff+pmwiki at gmail.com
Thu Dec 28 12:11:22 CST 2006


I put it in as a cookbook recipe (jsMath) last night.

It requires javascript to run.  Installing jsMath on your server is
fairly easy, however to get all the fonts installed it does take up
some space.

Enjoy using jsMath.

Ben Woodruff

On 12/26/06, Vince Administration <vadmin at math.uconn.edu> wrote:
> 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