Mathslate TinyMCE plugin

Mathslate TinyMCE plugin

написао/ла Daniel Thies -
Број одговора: 30
Слика Core developers Слика Plugin developers Слика Testers

Mathslate is now in a reasonably usable form, and I have repackaged it in a single plugin for Tinymce for Moodle 2.5 and Moodle 2.6 (unzip in lib/editor/tinymce/plugins/). When Moodle 2.7 is finalized, I will finish adding Atto and TinyMCE4 if they are included.

Mathslate is a javascript mathematical expression constructor. It relies on MathJax and YUI for the lower level functions. Users create and manipulate expressions from predefined templates or from TeX commands.  The associated TeX code is displayed as the expression is manipulated.  It is configurable with CSS and by editing a JSON file to change available templates. The TeX code is inserted into TinyMCE currently although it may configured for other input/output forms without a lot of trouble.Mathslate Screenshot

У одговору на Daniel Thies

Re: Mathslate TinyMCE plugin

написао/ла AL Rachels -
Слика Core developers Слика Particularly helpful Moodlers Слика Plugin developers Слика Testers

Hi Daniel,

Tried it in both Moodle 2.5 and 2.6. With debugging set to developer, both give the following debug info but still work:

String does not exist. Please check your string definition for nomathjax/tinymce_mathslate

  • line 9634 of /lib/moodlelib.php: call to debugging()
  • line 1125 of /lib/outputrequirementslib.php: call to lang_string->__construct()
  • line 1161 of /lib/outputrequirementslib.php: call to page_requirements_manager->string_for_js()
  • line 67 of /lib/editor/tinymce/plugins/mathslate/mathslate.php: call to page_requirements_manager->strings_for_js()

Invalid get_string() identifier: 'nomathjax' or component 'tinymce_mathslate'. Perhaps you are missing $string['nomathjax'] = ''; in /var/www/moodle26dev/moodle/lib/editor/tinymce/plugins/mathslate/lang/en/tinymce_mathslate.php?

  • line 293 of /lib/classes/string_manager_standard.php: call to debugging()
  • line 9663 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()
  • line 9688 of /lib/moodlelib.php: call to lang_string->get_string()
  • line 1488 of /lib/outputrequirementslib.php: call to lang_string->out()
  • line 907 of /lib/outputrenderers.php: call to page_requirements_manager->get_end_code()
  • line 82 of /lib/editor/tinymce/plugins/mathslate/mathslate.php: call to core_renderer->footer()

I think I am going to like trying to use this with my students. Much simpler look and fairly easy to use especially compared to  some other editors I've tried to use. Took me a while to realize, it doesn't work correctly when first run using Formal White theme. The window has to be widened and then the editor can be seen.

У одговору на AL Rachels

Re: Mathslate TinyMCE plugin

написао/ла Daniel Thies -
Слика Core developers Слика Plugin developers Слика Testers

Thanks I added the the language string to the git now so the error has gone away. Formal White is little puzzling.  It seems to have large fixed width margins for blocks even with embedded, popup page layouts. This squeezes the editor to nothing. I am not sure how to handle this at the moment.

У одговору на Daniel Thies

Re: Mathslate TinyMCE plugin

написао/ла AL Rachels -
Слика Core developers Слика Particularly helpful Moodlers Слика Plugin developers Слика Testers

Thanks for the info. I will update from git later today, when I get a chance. As for the block squeeze, we can live with that while we use it as an opportunity to try and learn some css. I am always looking for little "filler" projects for one or two of my more advanced students.

У одговору на Daniel Thies

Re: Mathslate TinyMCE plugin

написао/ла AL Rachels -
Слика Core developers Слика Particularly helpful Moodlers Слика Plugin developers Слика Testers

Just to let you know, my students (7th and 8th graders) and I have spent today playing with MathSlate. They really enjoyed how easy it was to create fairly complex equations using it, especially in comparison to the trouble they had trying to use straight TeX Notation, last week.

Just out of curiosity, before I start trying to play with my theme, what theme were you using when you made the picture you included in your first post above.

У одговору на AL Rachels

Re: Mathslate TinyMCE plugin

написао/ла Daniel Thies -
Слика Core developers Слика Plugin developers Слика Testers

I believe that picture was taken with the Magazine theme which is the one I use with my institutional site.

I tested all the themes in the Moodle core last night, and there seems to problems with Mathslate with the 'fixed width themes' . The plugin opens a 400 px popup window, and Mathslate resizes to whatever contains it. Afterburner, Boxie, Brick, and Splash set the width of the container to 800px so that only half of Mathslate is visible. These can be remedied by adding additional CSS containing

.mathslate-container {width: 375px;}

With Afterburner and Splash themes there is a spot in the settings to put it. For Brick and Boxie it can be edited into lib/editor/tinymce/plugins/mathslate/style.css.

For Formal White the problem is that it expects large margins (totaling 400+ px) even in embedded windows. The easiest option is probably readjusting windows size . This can be done by editing lib/editor/tinymce/plugins/mathslate/tinymce/editor_plugin.js and changing the window width in what is currently line 17 from 400 to 800. This will work with the other themes too if you like an 800 px popups.

Thank you for the report the report on your students.  I am glad to hear they enjoyed it.

У одговору на Daniel Thies

Re: Mathslate TinyMCE plugin

написао/ла AL Rachels -
Слика Core developers Слика Particularly helpful Moodlers Слика Plugin developers Слика Testers

Wow, thanks for the extra info. Works like you say in the other themes I tried. I used to use Magazine and might have to go back to it. Even works in Formal-White theme....in my non-production sites. My production site just laughs at me and still gives me the 400 width no matter what I do...tried different widths...purged caches....even rebooted server....and removed extra css. Oh well, something to look for over spring break. Probably something I did and just forgot about for now. No matter now, as from playing with it today, my students are already used to manually resizing the window.

У одговору на Daniel Thies

Re: Mathslate TinyMCE plugin

написао/ла AL Rachels -
Слика Core developers Слика Particularly helpful Moodlers Слика Plugin developers Слика Testers

I know that I do have some sort of problem with my current production site, as changing the width to 800 does not work, but works in my dev site with any browser.

However, I have noted another slight problem. When using Firefox if I click the minus sign button, it gets entered as a dash which gives an error. When I use Chrome, it gets entered correctly as a minus sign. Could you please check and see if you have the same result?

У одговору на AL Rachels

Re: Mathslate TinyMCE plugin

написао/ла Daniel Thies -
Слика Core developers Слика Plugin developers Слика Testers

Thank you. I updated the template for - in git, and it should insert the correct character now. 

Did you purge all caches or only the theme cache? TinyMCE plugins are stored indefinitely in the general javascript cache.  I think that purge all includes that, but it might not hurt to turn off javascript caching in the Developmental menu at least temporarily  and see if that resolves the issue.

У одговору на Daniel Thies

Re: Mathslate TinyMCE plugin

написао/ла AL Rachels -
Слика Core developers Слика Particularly helpful Moodlers Слика Plugin developers Слика Testers

Hi Daniel,

The latest code in github fixed our minus problem. The width is even working for us now. I realized that my wife had called me to supper the other night when I was going through and cleaning out caches and rebooting the server, etc. It was not until this morning that it suddenly dawned on me that I could not remember if I had emptied the history for Firefox. Once I did, the width started working correctly.

We have noticed a small problem with the text on the second MathSlate tool tab when using the Chrome web browser. While starting up, the text is centered like the others. When MathSlate is ready for use, the text is shifted downwards as shown in the included picture. Just wondering if you see the same thing.

MathSlate tabs in Chrome

Today we started trying to use the ATTO MathSlate plugin, but have not been able to get past the dependency check from the editor plugin checking for local_mathslate. No matter where I've placed the local_mathslate folder, the dependency check for editor_atto-mathslate fails. Could you please explain where I should place it?

If it helps, I am running a Centos 6.5 server with MathJax installed in .../www/html/MathJax/

My Moodle2.6 dev is in ...www/modle26dev/moodle

У одговору на AL Rachels

Re: Mathslate TinyMCE plugin

написао/ла Daniel Thies -
Слика Core developers Слика Plugin developers Слика Testers

Thank you. I shortened the label now.  The line was a little too long or the tab too thin. 

The moodle-local_mathslate plugin should be in ...www/modle26dev/moodle/local/mathslate. You should not have to fiddle with MathJax if it is already working on the site.

I updated the local repo a little earlier to reflect all the recent changes I have done in the TinyMCE version.  You should not have the Formal White problem with Atto.  It opens a standard  Moodle dialogue which should not be theme dependent.

 

У одговору на Daniel Thies

Re: Mathslate TinyMCE plugin

написао/ла AL Rachels -
Слика Core developers Слика Particularly helpful Moodlers Слика Plugin developers Слика Testers

Sorry, I did the same thing last time I had to install something in "local"...totally forgot that it is the name of a Moodle folder. Got MathSlate for Atto editor working now.

У одговору на AL Rachels

Re: Mathslate TinyMCE plugin

написао/ла Daniel Thies -
Слика Core developers Слика Plugin developers Слика Testers

I just updated the Atto plugin, it was not working for me with the current Atto in the database.  The version I originally used had a different way of handling plugins.  I have been working more now with TincyMCE because I do not know when Atto will be stable and documented.  Hopefully, early this Summer.  If you do have problems and are using Atto I will try to help where I can. It seems there are currently some CSS or spacing problems, but otherwise it seems to work ok.

Atto version of Mathslate

У одговору на AL Rachels

Re: Mathslate TinyMCE plugin

написао/ла Carlos Chiarella -

Hi Daniel,

In my institution we were using DragMath but this plugin looks very good. If we start using this plugin do we need to do any migration from courses that were using DragMath?

Thanks for your help,

 

Carlos

 

У одговору на Carlos Chiarella

Re: Mathslate TinyMCE plugin

написао/ла Daniel Thies -
Слика Core developers Слика Plugin developers Слика Testers

At the moment there is not really a reason for disabling Dragmath if you have users that are productive using it.  The two plugins should be  compatible. Both plugin normally produce TeX code, and it may be rendered the same way for both plugins.

Dragmath has had a long history and a lot of testing and revision.  Mathslate is new.  It has benefited from Dragmath's experience and features,  but it has not been thoroughly tested by users.    I would greatly appreciate anyone who has the opportunity to have students or faculty try it and give feedback. 

What needs to be done for transition depends on your institution.  You should be sure that it has all the need functionality for the assignments you currently do with Dragmath.  If functions or symbols are missing they can be added without a lot of effort. Also unnecessary one may  be removed to avoid confusion.

У одговору на Daniel Thies

Re: Mathslate TinyMCE plugin

написао/ла rahul pandey -

Dear Daniel,

I have installed mathslate by copying it to folder lib/editor/tinymce/plugins/

in editor it is showing like \(\frac{2}{3}\)

also while viewing the question after saving it

it is showing like \(\frac{2}{3}\)

do i need to install any other filter .

У одговору на rahul pandey

Re: Mathslate TinyMCE plugin

написао/ла Daniel Thies -
Слика Core developers Слика Plugin developers Слика Testers

Thank you Mikael, Chris did a great job with those instructions.  It is a useful resource.

Rahul, the Mathslate plugin is intended to construct a mathematical expression and output it as code (in this case TeX).  How that code is displayed or otherwise used depends on the particular needs of the site where it is installed, the users, and the hardware available. Either the TeX filter or Mathjax can be used with Mathslate for final display once the you exit tinyMCE and save your work.  The TeX code should be visible in TinyMCE while it is open, but should display after the page is saved if MathJax or the TeX filter are active on the page.

У одговору на Daniel Thies

Re: Mathslate TinyMCE plugin

написао/ла Shang Feng -

Hi Daniel:
Thank you for your Plugin. It is working very well.

Can you help me with one thing?

I put the below code  in to additional html header to display the TeX
code. Once I put this in. The Tex input field in your popup editor stop
working. when I pressed enter, I got this error message from the console.
1. Uncaught Error: Can't make callback from given data
[2]MathJax.js?config=TeX-AMS-MML_HTMLorMML:19

My moodle version is 2.5. Thank you for your time

Прилог Screen Shot 2014-03-11 at 10.37.01.png
У одговору на Shang Feng

Re: Mathslate TinyMCE plugin

написао/ла Mauno Korpelainen -

You need to give first MathJax.Hub.Config in

<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
...
  });
</script>

and after that separate script tags

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

(or whatever configuration you want to use)

Don't mix these tags.

У одговору на Mauno Korpelainen

Re: Mathslate TinyMCE plugin

написао/ла Shang Feng -

Thank you for your reply. 

I copied the code from @link http://docs.moodle.org/26/en/DragMath_equation_editor.

I eventually got it work by removing the inlineMath config of tex2jax.

I guess there is a conflict  between the config in the site header and the one for the plugin itself.

 

 

 

 

 

 

 

 

 

У одговору на Shang Feng

Re: Mathslate TinyMCE plugin

написао/ла Mauno Korpelainen -

This script configuration process changed already in MathJax version 1.1 to make it compatible with HTML5. Moodle Docs simply copy old docs from 2.x to 2.(x+1) automatically.

The latest version of MathJax is 2.3...

У одговору на Daniel Thies

Re: Mathslate TinyMCE plugin

написао/ла Daniel Thies -
Слика Core developers Слика Plugin developers Слика Testers

Hello,

The Mathslate editor is now available in the Plugins directory for Moodle 2.5+ and TinyMCE.  The current version I consider to be stable, and I will be using it with my Statistics students in the coming term. If anyone else is using it, I would be happy to know. Especially if you find something that needs to be fixed.



У одговору на Daniel Thies

Re: Mathslate TinyMCE plugin

написао/ла Greg Padberg -

We are evaluating the Mathslate plugin on our Moodle version 2.6.5.  I had the plugin installed on my test server and it worked OK but Mathslate doesn`t seem to fully start when loaded from our production server.  All the prerequisites seem to check out (TeX installed and enabled etc., texlive, imagemagick) and same settings for both.  Also installed libjs-mathjax and friends on the server with the same results.  Puzzling, as the new server is a newer version of the same distro (Ubuntu Server 14.04 production vs. 12.10 test environment).  The MathSlate Editor goes through loading mathjax, typesetting math up to 100% and ends up with a blank window.  Suggestions?

У одговору на Greg Padberg

Re: Mathslate TinyMCE plugin

написао/ла Daniel Thies -
Слика Core developers Слика Plugin developers Слика Testers

It may help to turn on Chrome or Firefox web Developer Console and see whether it throughs an error.  MathSlate loads MathJax and while it is processing loads a configuration file from the server. It is possible that this is being blocked for some reason, but that should show on the console. I don't know why it would not load though unless there is perhaps a problem with a protocol (http/https).

Another possiblity to check is that Mathslate is not trying to load its own copy of MathJax from CDN.  Check the Text Editors->TinyMCE->Mathslate configuration settings to see if the cdn url is there.  The version of MathJax in Ubuntu 14.04 is 2.3, and the CDN is the current 2.4 version.  These may be conflicting. If you want to run your local installation it is probably best to set the Mathslate MathJax url to empty.

У одговору на Daniel Thies

Re: Mathslate TinyMCE plugin

написао/ла Greg Padberg -

I tried a few things.  My production server is Ubuntu Server 14.04 LTS AMD64, test server is i386 architecture but I assume that should not matter.  On the production server I initially installed graphicmagick-imagemagick-compat instead of imagemagick and the prerequisites for the TeX filter seemed to be satisfied.  I subsequently installed imagemagick which added a few more packages.  And this morning I re-thought the TeX filter prerequisites, and did apt-get --purge remove graphicsmagick-imagemagick-compat and imagemagick, then apt-get install imagemagick.  Same result as before.  I also had libjs-mathjax installed and removed the Mathjax cdn url to use the local install, same result again except that it the (blank) window loads instantly.

У одговору на Greg Padberg

Re: Mathslate TinyMCE plugin

написао/ла Daniel Thies -
Слика Core developers Слика Plugin developers Слика Testers

Hello Greg,

I don't think that any of that should really make a difference.  Mathslate should appear and function even if the TeX filter is disabled or TeX binaries including Imagemagick are missing.  The only thing that Mathslate depends on are MathJax and YUI javascript libraries and these run in your browser not on the server. YUI is part of Moodle and should be working if your site is able to use the normal AJAX functionality of Moodle.

Normally if MathJax is not found at all, Mathslate displays a message that MathJax needs to be installed. So maybe it is installed, but not configured correctly. In order for MathJax to work in Moodle 2.6 you would have to added a link the javascript and a configuration in the header block of Site Settings->Appearance->Additional HTML.  It may be that there is something wrong with that.  If this is what you did and it is working TeX should be displayed throughout the site without the TeX filter. It might help to know exactly how this is set.

One thing you might also try is purging the caches.  Sometimes a cache may  hold a corrupted copy of MathJax.

У одговору на Daniel Thies

Re: Mathslate TinyMCE plugin

написао/ла Greg Padberg -

Oh for heck's sake!  Mathslate was working fine the whole time, of that I am now most certain.  It seems I've been looking too deeply at the problem.  It looks to be a theme display issue.  My production server is using a mostly stock Formal White theme, and the Mathslate window opens, loads, and appears to be empty.... until the Mathslate window is dragged wider to have the content visible, that is.  Of course my test server is running one of the new responsive design themes (Clean?) with which Mathslate works normally as intended.  The two servers running different themes explains why Mathslate was visible on my test server but not production.  Thanks again for all your suggestions, Daniel.

У одговору на Greg Padberg

Re: Mathslate TinyMCE plugin

написао/ла Daniel Thies -
Слика Core developers Слика Plugin developers Слика Testers

I forgot about the Formel White problem.  AL had the same problem on  earlier in this thread.  Formal White seems to always add 200px on both sides of a popup. This leaves no space for Mathslate.  The width of the window can be adjusted by editing mathslate/tinymce/editor_plugin.js to make it wider, but this is not an ideal soluton.