LaTeX in content bank do not show correct

LaTeX in content bank do not show correct

Bjørn Teistung發表於
Number of replies: 4
Hi, 

I am using LaTeX in H5P. 
When I use the activity chooser, and choose to add H5P interactive content, LaTeX output shows just fine:



But if I create an H5P activity in the content bank, LaTeX do not show as mathematical notation, only as LaTex code:



Any familiar with the same problem?

評比平均分數: -
In reply to Bjørn Teistung

Re: LaTeX in content bank do not show correct

Oliver Tacke發表於
Particularly helpful Moodlers的相片
Hei Bjørn!

Have you checked if the MathDisplay library is installed for the H5P integration in moodle core? The H5P plugin and the H5P integration in moodle core don't share libraries, so you may have to install it for the latter, too.

Best,
Oliver
In reply to Oliver Tacke

Re: LaTeX in content bank do not show correct

Bjørn Teistung發表於
Thanks , Oliver.
I brought your idea to our programmer.
We use a local installation of MathJax.
If we use a local MathJax installation we have to set absoulte URL in MathJax settings.
We have changed from "/path/to/mathjax" to
"https://domain/path/tp/mathjax".

But even this do not result in LaTeX showing correct when inserted in content bank. Any more tips?
In reply to Bjørn Teistung

Re: LaTeX in content bank do not show correct

Oliver Tacke發表於
Particularly helpful Moodlers的相片
Hei Bjørn!

Not sure if we are getting our wires crossed here.

There's the H5P plugin for moodle, and there is the moodle core integration of H5P. You need to make sure that the MathDisplay library is installed for both of them. Is it?

If yes, then you should be able to change the location of the MathJax libraries as you please, but that's step #2.

Best,
Oliver 
評比平均分數:Useful (2)
In reply to Oliver Tacke

Re: LaTeX in content bank do not show correct

Carsten Nielsen發表於

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  眨眼

Clear caches and it should work.

評比平均分數:Useful (3)