LaTeX in content bank do not show correct

Re: LaTeX in content bank do not show correct

by Carsten Nielsen -
Number of replies: 0

Thanks Oliver! Found it.  In this case it was a mixup between core_h5p and plugin mod_hvp.

For anyone struggling with the same issue:

Moodle 3.9 has a h5p implementation in core and the contentbank is preferring this over the mod_hvp plugin.
The core_h5p is using own libraries.

Install MathDIsplay library in core_h5p

1. Open the libraries-list under "Manage H5P content types" (/h5p/libraries.php), click the tab "Installed H5P libraries".
2. Check if "MathDisplay" is present. If not get it from here (there is a download link on the page) and upload it with the form on the same page. (The naming "Upload H5P content types" is a bit misleading here).

Adjust settings for local MathJax installation

The default setting of this library is to use the public mathjax-cdn. if you want to change that you have to modify your config.php by adding:

$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"
)
)
)
)
);

Adjust the "src" to point to the local mathjax installation. An absolute address (https://yourhost/...) will work, too.
Be sure to use "$CFG->core_h5p_library_config". The documentation on the h5p-website is for the mod_hvp plugin  wink

Clear caches and it should work.

Average of ratings: Useful (3)