Math expressión in H5P activities
Submitted by IvanFyQ on Sun, 10/23/2022 - 14:09
I am creating an interactive book and I need to use math expression in Latex but the task does not display correctly the expression.
I have installed the library in H5P content management, it shows MathDisplay installed (version 1.0.7).
I have installed MathJax 2.7.7. on my server and I have added a code in config.php of my moodle.$CFG->core_h5p_library_config = array(
"H5P.MathDisplay" => array(
"renderer" => array(
"mathjax" => array(
"src" => "/mathjax/MathJax.js",
"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"
in src, I have tried these options:
internal url of the my MathJax installation
I can't see the correct math expression using the next code latex:
How can I fix this problem?
Do I do any bad ?
Sun, 10/23/2022 - 23:29
Hi!First of all, your last
First of all, your last two examples are not valid LaTeX. The first one should work though.
The configuration that you can set is meant for the H5P plugin for moodle. You are using moodle's custom H5P integration however that was not created by the H5P core team, but by moodle. I am not convinced that setting a custom configuration setup will work the same way here, if at all.
The interesting thing here is that it should work without changing any configuration file given that you provide proper LaTeX.
Please check again with valid LaTeX and report any messages in your browser's development console, the network tab and your PHP error log.
Sun, 10/23/2022 - 23:36
Hi Oliver, I have noticed the
I have noticed the next:
If I create the h5p task in the bank content, the math expression is displayed correctly using $$latex$$ delimiters.
If I create using h5p interactive activity (green icon H5P), the math expression is not displayed.
Other user occurs the reverse: h5p interactive activities are fine and from content bank does not work.
Mon, 10/24/2022 - 08:19
The answer here is simple.
The answer here is simple. Both H5P integrations have nothing to do with each other. You need to install libraries for both including the Math Display library.
Mon, 10/24/2022 - 16:42
Thanks you Oliver.I
Thanks you Oliver.
I understand you but I don't know when I am using core H5P and when H5P plugin.
I think to have read that bank content activities are done by core H5P and in adding in a lesson/topic are plugin H5P. Is it ok?
I have installed one math display library. I think it is for core.
Is the another a plugin? Is it in Moodle repository?
It is some difficult to understand for inexpertise people.
Thank you a lot.
Tue, 10/25/2022 - 08:42
Glad you figured it out.There
Glad you figured it out.
There is an H5P plugin for moodle that was created by the H5P core team and has been around since 2016 if I am not mistaken. Later on, moodle HQ decided to put their own custom integration into moodle's core leading to the confusing situation that we have today - now that there are two solutions for the same thing that have nothing to do with each other.
Tue, 10/25/2022 - 01:10
HiI want to inform that I
I want to inform that I have solved this problem. Thanks everybody.