First version of AsciiSVG plugin ready for testing

Re: First version of AsciiSVG plugin ready for testing

by Marc Grober -
Number of replies: 8
Link to your demo package rezipped so that it can be placed in/ moodle and unzipped (no moving anything around.....
http://moodle.alaskapolicy.net/downloads/MK_PLUGIN_DEMO_asciisvg.zip

One of the issues I mentioned to you with the grapher is the need to have handy help as far as how to do things like $$\sqrt[3]27 $$ and as I recall there were issues with the grapger using different syntax than asciimath, or was that a different browser?

By the way, have you noticed the Tex error messages today??? Also note that the radical is not co extensive with the base?? I tested with parens and that did not help.....
Attachment tex_error.png
In reply to Marc Grober

Re: First version of AsciiSVG plugin ready for testing

by Mauno Korpelainen -

I haven't noticed such errors but it looks like tex settings code - I could check my logs...

I have used different packages with mathtex and commands like

http://korpelainen.net/cgi-bin/mathtex.cgi?\png\dpi{600}\gammacorrection{0.4}\displaystyle\sum_{m=1}^\infty\sum_{n=1}^\infty\frac{m^2\,n}{3^m\left(m\,3^n+n\,3^m\right)} to produce test images like

Example

- maybe my test server is just busy mixed

I found at least one way to get old asciisvg rendered at the same time with new plugin code - by embed tags like

<p><embed height="117" src="http://korpelainen.net/d.svg" script="initPicture(-2.5,2.5);circle([0,0],1);marker='arrowdot';line([-2,2],[2,-2]);axes();grid;" width="117"></embed></p>

but I really don't like the fact that IE shows blank boxes with old asciisvg.

It would be possible to use also attachments (see the attached file - but not with IE - somehow IE can mess it up even with adobe svg viewer...) or to create new resourse type for old version of asciisvg...

In reply to Marc Grober

Re: First version of AsciiSVG plugin ready for testing

by Marc Grober -
Current status?

$$\sqrt4=2$$ and $$\sqrt[3]27=3$$
In reply to Marc Grober

Re: First version of AsciiSVG plugin ready for testing

by Mauno Korpelainen -

Ah - this seems to be a new issue with TeX filter - most likely caused by recent security addons in code of TeX filter (latest files)

If you leave for example space before \alpha in

$ $ (space here) \alpha $ $

or use square brackets tex filter here in moodle.org gives those package tags.

-------------------------------------------------

I have almost finished my step 2 of math plugins - and will send you those download links to new packages tomorrow (should do the packing and checking of files today - only the necessary files among 100 test packages...)

My recent package on test server does allow also automathrecognize and uses now by default

`...` for asciimathml with mimetex fallback
$...$ for latexmathml with mathtex fallback (lots of extra features)

and as a new delimiter I took double @:s of algebra filter for better use and using them instead of dollars forces image fallback to mathtex for all browsers which is very useful with some FF font stuff...

More about subject tomorrow.

In reply to Marc Grober

Re: First version of AsciiSVG plugin ready for testing

by Mauno Korpelainen -

Marc, I am sorry to say this but I need still more time to check the mimetex side of scripts - in mathtex fallback everything works but mimetex does some things differently and some things are not supported so I need to offer two versions, one for mimetex and one for other latex distributions.

You can test the prototype plugins for asciimathml and latexmathml in http://korpelainen.net/plugindemo - Asciimaths for asciimaths and latexmaths.gif for latexmaths

Amath is automatically recognized but old style graphs with agraph tags are not used. Before I (or somebody else) can combine the old style asciisvg and new plugin based code we can only add old style code with embed tags but it is too complicated without modified media plugin.

Test site is using mimetex for rendering asciimathml (`...`) and latexmathml ($...$) and you can try using double @:s and latex syntax to render latex through modified asciimathml file - it's not translated with tex filter.

My wife has found a lot of new work for me from garden so I may need to help her for a while but I try to check the code on schedule and write the documentation etc during May.

In reply to Mauno Korpelainen

Re: First version of AsciiSVG plugin ready for testing

by Marc Grober -
Not to worry. This is one reason I wanted to spend time looking at production targets (gardening that is-LOL). My wife is going Outside (as we call contiguous 48 states) at planting time so I am off the hook this year! I am concerned about news re agraph and am wondering if current design for SEE is getting too complex? Have you looked at what SA did on fullxml? I have been trying to work through examples by way of building a bit of a primer for asciisvg/asciimath so that there are some ez to hand tools (examples in the EdTech wiki to be converted to lessons and quizzes that could be added to noodle feature demo)
In reply to Marc Grober

Re: First version of AsciiSVG plugin ready for testing

by Mauno Korpelainen -

Too complex - yes and no... I have tried to break code to smaller pieces so that these parts can be used together or separately - all of this stuff should work in moodle 2.0, it should work with all browsers, it should work with mimetex, mathtex etc.

It should work in plugins, be simple and easy to use but also be capable to produce old style svg graphs and fallbacks for IE... it should handle begin-end tags and do the same for amaths and agraphs... it should be able to handle different delimiters and modes (code/image/mathml)... yes, definitely, it's getting too complex.

These scripts can do it all but putting it all to one file is difficult. So I have used smaller pieces and combinations of these pieces to get it all work with my current server configuration. I wonder if we should simply combine such features that work everywhere to "basic files" and use 10-20 custom addons that can be used if needed. I could use 4000 latex symbols from tex live and give them ascii/unicode output for asciimathml but it may be easier to build smaller "example classes" of symbols. Maybe the next step is to create that activity (module) for custom input/output values that can be taken from database.

Sun is shining in Finland and summer is near... one month to go - but I'm still sure we have a nice package before my summer holidays - with a good documentation in moodle docs.

In reply to Marc Grober

Re: First version of AsciiSVG plugin ready for testing

by Mauno Korpelainen -

Missing agraph support is actually caused by two things:

Function DrawPictures is different in old and new versions written by Peter and David - therefore some old style graphs simply miss some parameters in new version. In tinymce setting avoidinnerHTML to false means that tinymce can't be used (editor won't show the content). On the other hand setting avoidinnerHTML to true gives tinymce but cuts simpleLaTeXformatting and ASCIIandgraphformatting. From my test files I totally took these off to avoid "extra code".

The key might be to set avoidinnerHTML to false and edit code of asciisvg to use similar syntax for plugin based graphs and old style graphs - but so far I have got it only partly functional and use avoidinnerHTML = false; to keep tinymce functional.

I did check some examples from fullxml but did not have yet time to look them closer...