Chemical formulas in H5P/Moodle
Submitted by rcambrosio on Mon, 06/08/2020 - 19:02
Forums:
Hello,
I use to write chemical formulas and equations on Moodle using mhchem package of MathJax. It works great. Recently I was introduced to H5P and find it amazing. The problem now is that H5P does not recognize my Latex formulas that I used to write on Moodle. Example: I am trying to use
*2* \(\ce{Mn^2+}\) + *4* \(\ce{MnO4^-}\) + *6* \(\ce{H2O}\) \(\ce{->}\) *8* \(\ce{MnO2}\) + *10* \(\ce{H^+}\)
on a "fill in the blank" exercice but it does not recognize my chemical equation.
Can anyone help me.
Thank you very much
Summary:
chemical equations
Content types:
otacke
Tue, 06/09/2020 - 01:39
Permalink
Hi rcambrosio!On your own
Hi rcambrosio!
On your own server, you can customize the MathDisplay library as described at https://h5p.org/mathematical-expressions - and it seems all you have to do is to add the \ce command, see https://mhchem.github.io/MathJax-mhchem/
Best,
Oliver
rcambrosio
Tue, 06/09/2020 - 13:36
Permalink
mhchem on H5P /moodle
Hello Oliver,
thanks for your help.
I still successfully use mhchem for MathJax inside Moodle. The problem is that the mhchem comands are not recognized inside H5M that I use in the same Moodle instalation. I apologize for my illiteracy on the subject, I dont't know how ho habilitate the mhchem on H5M. I downloaded the library on the link you sent and uploaded to Moodle but it istill dont work.
In my moodle instalation, on plugin filters I use:
MathJax.Ajax.config.path["mhchem"] =
"https://cdnjs.cloudflare.com/ajax/libs/mathjax-mhchem/3.3.2";
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$','$'], ['\\(','\\)']],
processEscapes: true
},
TeX: {
Macros: {
sen: "{\\operatorname{sen}}",
senh: "{\\operatorname{senh}}",
arcsen: "{\\operatorname{arcsen}}",
arcsenh: "{\\operatorname{arcsenh}}",
arccos: "{\\operatorname{arccos}}",
arccosh: "{\\operatorname{arccosh}}",
arctg: "{\\operatorname{arctg}}",
arctgh: "{\\operatorname{arctgh}}",
cossec: "{\\operatorname{cossec}}",
cossech: "{\\operatorname{cossech}}",
sech: "{\\operatorname{sech}}",
tg: "{\\operatorname{tg}}",
tgh: "{\\operatorname{tgh}}",
cotg: "{\\operatorname{cotg}}",
cotgh: "{\\operatorname{cotgh}}",
arcsec: "{\\operatorname{arcsec}}",
dist: "{\\operatorname{dist}}",
mdc: "{\\operatorname{mdc}}",
mmc: "{\\operatorname{mmc}}",
C: "{\\mathbb{C}}",
R: "{\\mathbb{R}}",
Q: "{\\mathbb{Q}}",
Z: "{\\mathbb{Z}}",
N: "{\\mathbb{N}}"
},
extensions: ["[mhchem]/mhchem.js"]
},
config: ["Accessible.js", "Safe.js"],
errorSettings: { message: ["!"] },
skipStartupTypeset: true,
messageStyle: "none"
});
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
MathJax.Hub.Insert(MathJax.InputJax.TeX.Definitions.macros,{
cancel: ["Extension","cancel"],
bcancel: ["Extension","cancel"],
xcancel: ["Extension","cancel"],
cancelto: ["Extension","cancel"]
});
});
otacke
Tue, 06/09/2020 - 20:00
Permalink
Hi!I am sorry, but I fear I
Hi!
I am sorry, but I fear I can't tell you anything that's not already described on the two pages that I linked to.
Best,
Oliver
Jalmer
Mon, 06/14/2021 - 16:57
Permalink
Chemical formulas
I got the same trouble, but by using \require{mhchem}\ce{...} it is working. Just needed once inside a H5P-file.