moodle-mod_hvp
moodle-mod_hvp copied to clipboard
Latex in h5p Interactive Content
Hello, using moodle 4.1 When I try to use default Latex function /operatorname in h5p Interactive Content it doesnt work, but in the same time it does work if placed in Description the Latex line is: (\operatorname{arctg} (-a)=\pi -\operatorname{arctg} a)
https://www.evernote.com/shard/s456/sh/9e94108a-8e73-3519-448e-5e8335124e9e/7d4c49b72d936fee093f2735b0aca3ef
@EgoDaemonium The description field is part of Moodle, not H5P. In order to use LaTeX in H5P, you will need to install the MathDisplay add-on .
@otacke thanks for quick response! We already have this addon installed, but operatorname still doesn’t work in Content part
You'll have to leave some more information then. "X is not working" is not really enough. Please have a look at https://h5p.org/forum/9 and use that forum.
there are 11 points in that forum. and most of them are already present in initial ticket.
- Detailed steps to reproduce the bug (exactly how and when did it happen) https://www.evernote.com/shard/s456/sh/9e94108a-8e73-3519-448e-5e8335124e9e/7d4c49b72d936fee093f2735b0aca3ef
- Platform and version number. E.g. Drupal, Wordpress, Moodle. using moodle 4.1
- Mobile or Desktop it's not working in any platform
- Browser: Chrome, Firefox, Safari etc tested in Chrome and Firefox
- H5P plugin version 1.23.0 MathDisplay add-on mentioned earlier 1.0.7
- H5P content type and version (if a content type was used), and a sample URL or attached H5P. present on screenshots https://www.evernote.com/shard/s456/sh/9e94108a-8e73-3519-448e-5e8335124e9e/7d4c49b72d936fee093f2735b0aca3ef
- Any browser console errors nothing
- Any [PHP errors] Undefined control sequence \operatorname
- Screenshots if it's a visual problem https://www.evernote.com/shard/s456/sh/9e94108a-8e73-3519-448e-5e8335124e9e/7d4c49b72d936fee093f2735b0aca3ef
- Any recent changes to the environment (new plugins/modules, updates, configuration changes etc.) we had same problem in moodle 3.9 - \operatorname never worked
- Any recent changes to the browser you're using (new extensions, updates etc.) nothing
please let me know if you need any more specific details
@EgoDaemonium That's not a message from H5P, but from MathJax. That is the rendering library used by MathDisplay.
I am no LaTeX expert, but I assume that the package that provides \operatorname is not installed with MathJax by default and the very basic configuration that the MathDisplay library is shipped with doesn't use it. As far as I understand, some extension called ams needs to be set.
You may need to customize the MathJax configuration of the MathDisplay library, see https://h5p.org/mathematical-expressions
found solution for my problem. placed MathDisplay config in moodle config.php file
$CFG->mod_hvp_library_config = array( "H5P.MathDisplay" => array( "observers" => array( array("name" => "mutationObserver", "params" => array("cooldown" => 500)), array("name" => "domChangedListener"), array("name" => "interval", "params" => array("time" => 1000)) ), "renderer" => array( "mathjax" => array( "src" => "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML", "config" => array( "extensions" => array("tex2jax.js"), "jax" => array("input/TeX", "output/HTML-CSS"), "tex2jax" => array( // Important, otherwise MathJax will be rendered inside CKEditor "ignoreClass" => "ckeditor" ), "messageStyle" => "none" ) ) ) ) );