After reading this Adding Mathjax to a Joomla website
I don't know anything about writing extention but based on mentioned link, I am assuming it is should be easy to write a simple system plugin to enable both mathjax and latex2html5.
I come up with this
<?php
// no direct access
defined('_JEXEC') or die('Restricted index access');
class plgSystemMathJaxLatex2Html5 extends JPlugin {
public function onContentPrepare($context, &$article, &$params, $page = 0)
{
$doc = JFactory::getDocument();
$doc->addScript("http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML");
$doc->addScript(plugins/system/MathJaxLatex2Html5/assets/js/latex2html5.min.js);
$doc->addStyleSheet(plugins/system/MathJaxLatex2Html5/assets/css/latex2html5.css);
}
}
Link to the installation of latex2html5 http://latex2html5.com/installation.html
I think the only thing left now is how to include the required mathjax config into plugin.
<script type="text/x-mathjax-config">
// <![CDATA[
MathJax.Hub.Config({
TeX: {extensions: ["AMSmath.js", "AMSsymbols.js"]},
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
showProcessingMessages : false,
messageStyle : "none" ,
showMathMenu: false ,
tex2jax: {
processEnvironments: true,
inlineMath: [ ['$','$'], ["\(","\)"] ],
displayMath: [ ['$$','$$'], ["\[","\]"] ],
preview : "none",
processEscapes: true
},
"HTML-CSS": { linebreaks: { automatic:true, width: "latex-container"} }
});
// ]]>
</script>
Can anyone please guide me to the completion of the plugin?
Thanks