SA's version vs "current" fallback 2.x version

4 views
Skip to first unread message

Marc Grober

unread,
Apr 30, 2009, 6:11:08 PM4/30/09
to asci...@googlegroups.com
SA, I tested some examples
(http://edtech.alaskapolicy.net/index.php?title=Exploring_ASCIIMathML_-_A_Sandbox)
with your three js files as against the version I am
presently using
(http://moodle.alaskapolicy.net/lib/editor/common/asciimath/ASCIIMathML.js)
and ran into quite a few problems; lots of inconsistencies.
Have not worked through them but there seem to be quite a
few problems with parens as well as square and curly
brackets. Also seem to be losing some subscript
functionality.....

**************

David, I really do think we need a "current" core script
that is capable of operating with or calling additional js
libraries if the direction is going to be to pull asciisvg
and latexml out of the core (though I am not sure how you
could easily back the fallback out of the core

David

unread,
May 1, 2009, 12:05:29 AM5/1/09
to ASCIIMath
The fallback is almost independent of ASCIIMathML.js; they use the
same AMsymbols table. The link in to the original script is only in
the strarr2docFrag function; if MathML is available, the original
AMparseMath is used. If not, the fallback AMTparseMath is used
instead.

I think my goal will be to keep the fallback script maintained :)
That should only require maintaining the separate AMT functions, and
occasionally updating the symbols table.


On Apr 30, 3:11 pm, Marc Grober <m...@interak.com> wrote:
> SA,  I tested some examples
> (http://edtech.alaskapolicy.net/index.php?title=Exploring_ASCIIMathML_...)
> with your three js files as against the version I am
> presently using
> (http://moodle.alaskapolicy.net/lib/editor/common/asciimath/ASCIIMathM...)
> and ran into quite a few problems; lots of inconsistencies.
> Have not worked through them but there seem to be quite a
> few problems with parens as well as square and curly
> brackets. Also seem to be losing some subscript
> functionality.....
>
>         **************
>
> David, I really do think we need a "current" core script
> that is capable of operating with or calling additional js
> libraries if the direction is going to be to pull asciisvg
> and latexml out of the core (though I am not sure how you
> could easily back the fallback out of the core
>
>  smime.p7s
> 4KViewDownload

miedema

unread,
May 1, 2009, 10:17:17 AM5/1/09
to ASCIIMath
All I changed with respect to the combined ASCIIMathML op Peter is the
mathjs function for the ASCIIMathML part and the <sup> replacement in
the LaTeX part, so if you use the original mathjs function most of the
inconsistencies should have gone.
But I mist say that the combined version, ASCIIMathML, ASCIIsvg and
LaTeXMathML in one big javascript, which according to my knowledge is
the latest version of Peter Jipsen, is not consistent with examples on
his own website which use the separate javascripts.
With the remarks of David, I will try to implement the fallback
function which was not part of the latest version I downloaded.
On the other hand, I don't see any problem for people to download the
MathML player and the SVG plugin in IE, its just a few minutes work
and it works immediately. I also use the latest Firefox, which is easy
to download and install.
The only problem I have with Firefox is the use of the filters, it
hangs Firefox and Firefox does not show wmf files.
So I tell my students to test IE with the two plugins before they do
online examinations and this never causes trouble.

On May 1, 12:11 am, Marc Grober <m...@interak.com> wrote:
> SA,  I tested some examples
> (http://edtech.alaskapolicy.net/index.php?title=Exploring_ASCIIMathML_...)
> with your three js files as against the version I am
> presently using
> (http://moodle.alaskapolicy.net/lib/editor/common/asciimath/ASCIIMathM...)
> and ran into quite a few problems; lots of inconsistencies.
> Have not worked through them but there seem to be quite a
> few problems with parens as well as square and curly
> brackets. Also seem to be losing some subscript
> functionality.....
>
>         **************
>
> David, I really do think we need a "current" core script
> that is capable of operating with or calling additional js
> libraries if the direction is going to be to pull asciisvg
> and latexml out of the core (though I am not sure how you
> could easily back the fallback out of the core
>
>  smime.p7s
> 4KViewDownload

David

unread,
May 1, 2009, 10:23:00 AM5/1/09
to ASCIIMath
If it is reasonable for you to require your users to download plugins
or a different browser, then that is definately the preferable way to
go, and there is no reason to add fallback.

I only developed the fallback scripts because there are applications
where requiring those steps is not reasonable.
> > 4KViewDownload- Hide quoted text -
>
> - Show quoted text -

miedema

unread,
May 1, 2009, 10:24:17 AM5/1/09
to ASCIIMath
I checked your site and it seems the inconsistencies are because in my
version each line should end with a ; (semicolon).
I don't know why because I didn't change this part, but I will try to
make it operate without the ; again, so your page should work.

On May 1, 12:11 am, Marc Grober <m...@interak.com> wrote:
> SA,  I tested some examples
> (http://edtech.alaskapolicy.net/index.php?title=Exploring_ASCIIMathML_...)
> with your three js files as against the version I am
> presently using
> (http://moodle.alaskapolicy.net/lib/editor/common/asciimath/ASCIIMathM...)
> and ran into quite a few problems; lots of inconsistencies.
> Have not worked through them but there seem to be quite a
> few problems with parens as well as square and curly
> brackets. Also seem to be losing some subscript
> functionality.....
>
>         **************
>
> David, I really do think we need a "current" core script
> that is capable of operating with or calling additional js
> libraries if the direction is going to be to pull asciisvg
> and latexml out of the core (though I am not sure how you
> could easily back the fallback out of the core
>
>  smime.p7s
> 4KViewDownload

miedema

unread,
May 1, 2009, 10:38:09 AM5/1/09
to ASCIIMath
But David as far as I understand the fallback scripts are only for the
MathML part and not for the SVG part?
> > - Show quoted text -- Hide quoted text -

Marc

unread,
May 1, 2009, 11:42:31 AM5/1/09
to asci...@googlegroups.com

SA,
This was one of the first things that struck me as odd, that there
were no semicolons required if there was anew line.......

Before you change your script maybe we should require the semicolon at
the end of every logical line......

David, peter, what do you guys think??

David

unread,
May 1, 2009, 11:43:11 AM5/1/09
to ASCIIMath
Generally true - the main fallback scripts are for MathML fallback.

The tinymce plugins I created do provide for image-based fallback of
editor-created SVG graphs (using a php script), and I use the same
fallback to provide image-based fallback for graphs in my LMS project,
but of course those graphs are not dynamic, can only support a subset
of functions, and adding additional functionality like you have is
limited by what I can duplicate in PHP.

David

unread,
May 1, 2009, 11:45:07 AM5/1/09
to ASCIIMath
I have no opinion. If I remember right, the original version of
asciisvg just executed javascript, and javascript has weird rules for
when a semicolon is required and when it isn't. Standardizing it to
always require one makes sense, but could break a lot of existing
stuff.

On May 1, 8:42 am, Marc <m...@interak.com> wrote:
> SA,
> This was one of the first things that struck me as odd, that there  
> were no semicolons required if there was anew line.......
>
> Before you change your script maybe we should require the semicolon at  
> the end of every logical line......
>
> David, peter,   what do you guys think??
>

Marc

unread,
May 1, 2009, 11:49:19 AM5/1/09
to asci...@googlegroups.com
I am also not an MS fan, but there are institutions where IE use is
mandatory and plugins prohibited. And there is also the font issue. So
I like an annoying little one per session warning that the folks
forcing you to use a browser that does not support a W3C standard need
some badgering

Marc

unread,
May 1, 2009, 12:04:24 PM5/1/09
to asci...@googlegroups.com
Could this be handled with a
AMsemireq=true
Or some such so that the script would not break existing code?

Marc

unread,
May 1, 2009, 12:21:04 PM5/1/09
to asci...@googlegroups.com
BTW, while I greatly appreciate peter setting this google group up,
but google still isn't supporting js, so would it be appropriate to
consider some alternative of supplemental options? I'd argue moodle as
it offers the same features but would support asciimath and Peter and
David are already familiar with it. I'd be willing to host it, though
an affiliation with a college might be more appropriate. On the other
hand - peter didn't use moodle - LOL

One intriguing aspect of moodle is that asciimath can be invoked via
theme and users can select their own theme, so it would be easy enough
to have multiple scripts available via different themes

miedema

unread,
May 1, 2009, 3:49:23 PM5/1/09
to ASCIIMath
Maybe the inconsistenty issue is because of using agraph-endagraph?,
when i tried examples of Peter with embed I didn't have this issue,
when I used agraph-endagraph I had this issue.

On May 1, 6:21 pm, Marc <m...@interak.com> wrote:
> BTW, while I greatly appreciate peter setting this google group up,  
> but google still isn't supporting js, so would it be appropriate to  
> consider some alternative of supplemental options? I'd argue moodle as  
> it offers the same features but would support asciimath and Peter and  
> David are already familiar with it. I'd be willing to host it, though  
> an affiliation with a college might be more appropriate. On the other  
> hand - peter didn't use moodle - LOL
>
> One intriguing aspect of moodle is that asciimath can be invoked via  
> theme and users can select their own theme, so it would be easy enough  
> to have multiple scripts available via different themes
>
> On May 1, 2009, at 8:04 AM, Marc <m...@interak.com> wrote:
>
>
>
>
>
> > Could this be handled with a
> > AMsemireq=true
> > Or some such so that the script would not break existing code?
>

miedema

unread,
May 5, 2009, 10:00:56 AM5/5/09
to ASCIIMath
David,

I added the fallback functionality to ASCIIMathML v2.1, the latest
version from Peter's site, but it took some searching.
First I did what you told, but then it still didn't work, so after
some hours I found:
if (st=="-" && AMpreviousSymbol==INFIX) {
AMcurrentSymbol = INFIX; //trick "/" into recognizing "-" on
second parse
return {input:st, tag:tagst, output:st, ttype:UNARY, func:true,
val:true};
}
return {input:st, tag:tagst, output:st, ttype:CONST, val:true};
In the AMgetSymbol function, the last lines, the val:true is not there
in the original ASCIIMathML.
I added a variable : var MathMLFallBack = true; // true if FallBack
module available
and put all the FallBack functionality in a separate javascript
ASCIIMathMLFallBack.js.
So now it has the idea of a plugin, you can turn it on and off.
I'm also trying to do the same with my extra SVG functions.

So there will be a new version soon which is compatible with Peters
version 2.1, but with FallBack and a big library of SVG functions,
both in separate files.

David

unread,
May 5, 2009, 11:33:23 AM5/5/09
to ASCIIMath
BTW, where did you find a v2.1 on Peter's site? I only see a 2.0.1
(Sept 27, '07) version being used. I know there is a 2.0.7 version
(Nov 3, '07) version, which is the one I had worked with briefly.

mauno

unread,
May 5, 2009, 1:57:45 PM5/5/09
to ASCIIMath
Latest version or not but http://mathcs.chapman.edu/~jipsen/mathml/asciimathdownload.html

... Here is the script: ASCIIMathML.js (right-click on the link and
choose "Save Target As..." if your browser does not display the
JavaScript code).

And ASCIIMathML.js has text:

Version 2.1 Oct 8, 2008, (c) Peter Jipsen http://www.chapman.edu/~jipsen
This version extends ASCIIMathML.js with LaTeXMathML.js and
ASCIIsvg.js.
Latest version at http://www.chapman.edu/~jipsen/mathml/ASCIIMathML.js
If you use it on a webpage, please send the URL to jip...@chapman.edu
> > > - Show quoted text -- Hide quoted text -

mauno

unread,
May 5, 2009, 2:03:06 PM5/5/09
to ASCIIMath
So http://www1.chapman.edu/~jipsen/mathml/ASCIIMathML.js has version
2.0.1 Sept 27, 2007

but http://mathcs.chapman.edu/~jipsen/mathml/ASCIIMathML.js has
version 2.1 Oct 8, 2008

On May 5, 6:33 pm, David <drlipp...@yahoo.com> wrote:
> > > - Show quoted text -- Hide quoted text -

miedema

unread,
May 5, 2009, 2:48:42 PM5/5/09
to ASCIIMath
Correct, thats where I got the 2.1 version, which now has the fallback
function on my computer.
I'm still working on it to make my version 100% compatible with Peters
version.
Right now the ASCIIMathML and LaTeXMathML part are, but the SVG part
has almost tripled.

One question, are you using the arc and sector functions a lot?
I changed them so both functions have a center, startangle, endangle
and radius, this way its much easier to get the arc where you want it.

On May 5, 8:03 pm, mauno <mauno.korpelai...@hyvinkaa.fi> wrote:
> Sohttp://www1.chapman.edu/~jipsen/mathml/ASCIIMathML.jshas version

David

unread,
May 5, 2009, 6:10:50 PM5/5/09
to ASCIIMath
Ahh... got it. The only difference I see between 2.1 and the latest
version I had seen is that Opera support for MathML was enabled.

mauno

unread,
May 6, 2009, 1:26:19 AM5/6/09
to ASCIIMath
And there are those two versions of 2.0.9 Nov 3, 2007
http://www.pierce.ctc.edu/dlippman/asciimathtex/AMT.html and
http://www.pierce.ctc.edu/dlippman/asciimathtex/ASCIIMathMLwFallback2.js
that has AMT functions ... and http://www.imathas.com/editordemo/ASCIIMathML2wMnGFallback.js
that has also ASpreprocess and parseShortScript functions.

Version 2.1 does not have AMT and it does not have ASpreprocess/
parseShortScript functions.

miedema

unread,
May 6, 2009, 2:30:29 AM5/6/09
to ASCIIMath
What exactly is the functionality of ASpreprocess and
parseShortScript?

On May 6, 7:26 am, mauno <mauno.korpelai...@hyvinkaa.fi> wrote:
> And there are those two versions of  2.0.9 Nov 3, 2007http://www.pierce.ctc.edu/dlippman/asciimathtex/AMT.htmlandhttp://www.pierce.ctc.edu/dlippman/asciimathtex/ASCIIMathMLwFallback2.js
> that has AMT functions ... andhttp://www.imathas.com/editordemo/ASCIIMathML2wMnGFallback.js
> that has also ASpreprocess and parseShortScript functions.
>
> Version 2.1 does not have AMT and it does not have ASpreprocess/
> parseShortScript functions.
>
> On May 6, 1:10 am, David <drlipp...@yahoo.com> wrote:
>
>
>
> > Ahh... got it.  The only difference I see between 2.1 and the latest
> > version I had seen is that Opera support for MathML was enabled.- Hide quoted text -

David

unread,
May 6, 2009, 10:16:12 AM5/6/09
to ASCIIMath
They are both used to handle the output of the tinymce graph editor
plugin, which produces a "sscr" attribute instead of a "script"
attribute. The graph plugin can also use image fallback for editor-
produced graphs.

As I recall, when I created the ASCIIMathML2wMnGFallback.js, I wanted
to avoid modifying existing functions as much as possible. So I added
ASpreprocess in the onload function. It looks for the "sscr"
attribute from the editor plugin. If the browser does not support
SVG, it uses image fallback, otherwise it converts the sscr attribute
to a standard asciisvg "script" attribute using the parseShortScript
function.

The parseShortScript converts the editor short script (sscr) notation
to standard asciisvg commands.

I forgot I had already written this part :)

On May 5, 11:30 pm, miedema <webmas...@samconsult.biz> wrote:
> What exactly is the functionality of ASpreprocess and
> parseShortScript?
>
> On May 6, 7:26 am, mauno <mauno.korpelai...@hyvinkaa.fi> wrote:
>
> > And there are those two versions of  2.0.9 Nov 3, 2007http://www.pierce.ctc.edu/dlippman/asciimathtex/AMT.htmlandhttp://www...
Reply all
Reply to author
Forward
0 new messages